public virtual MvcMailMessage NotifyFailedLoginAttemptMessage(EmailNotifyFailedLoginAttemptModel model) { ViewData.Model = model; return Populate(x => { x.Subject = "Notification " + model.SiteName; x.ViewName = "NotifyFailedLoginAttempt"; x.To.Add(model.ToEmail); }); }
public ActionResult SendNotifyFailedLoginEmail(string username) { Account account = AccountRepos.Get(username); EmailNotifyFailedLoginAttemptModel model = new EmailNotifyFailedLoginAttemptModel() { SiteName = siteName, SiteUrl = siteUrl, ToEmail = account.Email, }; UserMailer mailer = new UserMailer(); mailer.NotifyFailedLoginAttemptMessage(model).Send(); return RedirectToAction("RequestChangePasswordSuccess", "Account"); }