Beispiel #1
0
        public void ShouldBeAbleToComposeEmail()
        {
            string        methodName = nameof(ShouldBeAbleToComposeEmail);
            EmailComposer composer   = SetStringFormatComposerAndTestTemplate(methodName);

            string subject = "This is the Subject";
            Email  email   = composer.Compose(subject, _testTemplateName, "Baloney");

            Expect.IsNotNullOrEmpty(email.Config.Subject);
            Expect.IsNotNullOrEmpty(email.Config.Body);

            Expect.AreEqual(subject, email.Config.Subject);

            string body = _stringFormatContent._Format("Baloney");

            Expect.AreEqual(body, email.Config.Body);
        }
Beispiel #2
0
        public void ShouldBeAbleToComposeNamedEmail()
        {
            string        methodName = nameof(ShouldBeAbleToComposeNamedEmail);
            EmailComposer composer   = SetNamedFormatComposerAndTestTemplate(methodName);

            string subject = "This is the Subject";
            object data    = new { Monkey = "Baloney", Banana = "Bananas" };
            Email  email   = composer.Compose(subject, _testTemplateName, data);

            Expect.IsNotNullOrEmpty(email.Config.Subject);
            Expect.IsNotNullOrEmpty(email.Config.Body);

            Expect.AreEqual(subject, email.Config.Subject);

            string body = _namedFormatContent.NamedFormat(data);

            Expect.AreEqual(body, email.Config.Body);
        }
Beispiel #3
0
        protected internal Email ComposePasswordResetEmail(string subject, object data)
        {
            Email email = EmailComposer.Compose(subject, PasswordResetEmailName, data);

            return(EmailComposer.SetSmtpHostSettings(SmtpSettingsVault, email));
        }
Beispiel #4
0
        protected internal Email ComposeConfirmationEmail(string subject, object data)
        {
            Email email = EmailComposer.Compose(subject, AccountConfirmationEmailName, data);

            return(EmailComposer.SetSmtpHostSettings(SmtpSettingsVault, email));
        }