Пример #1
0
        public IActionResult EmailLayout()
        {
            var themes = EnumX.AllValues <Theme>();

            var languages = PlainText.AcceptedLanguages();

            var fakeUsers =
                from language in languages
                from theme in themes
                select fakeUser(language, theme);

            var result =
                from fakeUser in fakeUsers
                select getLayout(Format.MoveNotification(fakeUser))
                + getLayout(Format.SecurityAction(fakeUser, SecurityAction.PasswordReset))
                + getLayout(Format.SecurityAction(fakeUser, SecurityAction.UserVerification))
                + getLayout(Format.UserRemoval(fakeUser, RemovalReason.NoInteraction))
                + getLayout(Format.UserRemoval(fakeUser, RemovalReason.NotSignedContract))
                + getLayout(Format.WipeNotice(fakeUser, RemovalReason.NoInteraction))
                + getLayout(Format.WipeNotice(fakeUser, RemovalReason.NotSignedContract))
                + getLayout(Format.WipeNotice(fakeUser, RemovalReason.PersonAsked))
            ;

            return(View(result));
        }
Пример #2
0
        public ConfigsIndexModel()
        {
            var languageDictionary =
                PlainText.AcceptedLanguages()
                .ToDictionary(l => l, l => translator["Language" + l]);

            LanguageList = SelectListExtension.CreateSelect(languageDictionary);
            TimeZoneList = SelectListExtension.CreateSelect(TZ.All);

            Info = new ConfigInfo
            {
                UseCategories    = current.UseCategories,
                UseAccountsSigns = current.UseAccountsSigns,
                SendMoveEmail    = current.SendMoveEmail,
                MoveCheck        = current.MoveCheck,
                Wizard           = current.Wizard,
                Language         = current.Language,
                TimeZone         = current.TimeZone,
            };
        }
Пример #3
0
        private static IDictionary <String, EmailType> chargeTypes()
        {
            var types = new Dictionary <String, EmailType>
            {
                { EmailType.MoveNotification.ToString(), EmailType.MoveNotification },
            };

            EnumX.AllExcept(SecurityAction.UnsubscribeMoveMail)
            .ForEach(
                sa => types.Add(sa.ToString(), EmailType.SecurityAction)
                );

            EnumX.AllValues <RemovalReason>()
            .ForEach(
                rr => types.Add(rr.ToString(), EmailType.RemovalReason)
                );

            types.Add(
                EmailType.WipeNotice.ToString(),
                EmailType.WipeNotice
                );

            var langs = PlainText.AcceptedLanguages();
            var keys  = types.Keys.ToList();

            foreach (var key in keys)
            {
                var value = types[key];
                types.Remove(key);

                foreach (var lang in langs)
                {
                    var newKey = PlainText.Email[key, lang, "Subject"];
                    types.Add(newKey, value);
                }
            }

            return(types);
        }