Example #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));
        }
Example #2
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);
        }
Example #3
0
 public void GivenIHaveTheseThemes()
 {
     themes = EnumX.AllValues <Theme>();
 }
Example #4
0
 public void GivenIHaveTheseEmailTypes()
 {
     emailTypes = EnumX.AllValues <EmailType>();
 }