コード例 #1
0
        public static string ApplyHtmlToEmailBody(PendingUser pendingUser)
        {
            // would MUCH RATHER have pulled in a string from a .HTML file here to make for easier changes in future but for now...
            string html = EmailHtmlTemplate.EmailContent;
            var finalEmailBody = GetEmailBody(pendingUser);

            return html.Replace(EmailContentTag, finalEmailBody);
        }
        public void CanReadEmailTemplateFileFromApp()
        {
            var pendingUser = new PendingUser
            {
                CAN = "123",
                Id = Guid.NewGuid(),
                Email = "*****@*****.**",
                FirstName = "Freddie",
                LastName = "Llunjberg"
            };

            string html = RegistrationCompleteEmail.ApplyHtmlToEmailBody(pendingUser);
            Assert.IsTrue(html.Contains("Dear Freddie Llunjberg"));
            //pendingUser.SendRegistrationCompleteEmail();
        }
コード例 #3
0
 public static string GetEmailBody(PendingUser pendingUser)
 {
     return _emailBody
         .Replace(ClientNameTag, pendingUser.FirstName + " " + pendingUser.LastName)
         .Replace(LoginLink, LoginUrl);
 }
コード例 #4
0
 public static string GetEmailBody(PendingUser pendingUser)
 {
     return _emailBody
         .Replace(ClientNameTag, pendingUser.FirstName + " " + pendingUser.LastName)
         .Replace(RegistrationLinkTag, pendingUser.EntryPointURL() );
 }