示例#1
0
 public MvcMailMessage ConfirmationTokenMessage(EmailConfirmationModel model)
 {
     ViewData.Model = model;
     return Populate(x =>
     {
         x.Subject = "Activate your account " + model.SiteName;
         x.ViewName = "ConfirmAccount";
         x.To.Add(model.ToEmail);
     });
 }
        public ActionResult SendAccountConfirmationEmail(string username, string token)
        {
            Account account = AccountRepos.Get(username);
            EmailConfirmationModel model = new EmailConfirmationModel()
            {
                SiteName = siteName,
                SiteUrl = siteUrl,
                UserName = account.UserName,
                FirstName = account.FirstName,
                ToEmail = account.Email,
                ConfirmationToken = token,
                ConfirmationUrl = siteUrl + "/Account/ConfirmAccount?u=" + account.UserName + @"&t" + token
            };

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