Exemplo n.º 1
0
 public virtual MvcMailMessage WelcomeMessage(EmailWelcomeModel model)
 {
     ViewData.Model = model;
     return Populate(x =>
     {
         x.Subject = "Welcome to "+ model.SiteName;
         x.ViewName = "Welcome";
         x.To.Add(model.ToEmail);
     });
 }
Exemplo n.º 2
0
        public ActionResult SendWelcomeEmail(string username)
        {
            Account account = AccountRepos.Get(username);
            EmailWelcomeModel model = new EmailWelcomeModel()
            {
                SiteName = siteName,
                SiteUrl = siteUrl,
                FirstName = account.FirstName,
                LoginUrl = siteUrl + "/Account/login",
                SiteHelpUrl = siteUrl + "/Help/",
                ToEmail = account.Email,
                UserName = account.UserName
            };

            UserMailer mailer = new UserMailer();
            mailer.WelcomeMessage(model).Send();
            return RedirectToAction("RegistrationSuccess", "Account");
        }