string IAccountService.ForgotUserName(ForgotUserNameModel model) { var username = this.GetUserName(model.Email); if (username != null) { this.emailHelper.SendUserNameMail(model.Email, username); return username; } return null; }
public virtual ActionResult ForgotUserName(ForgotUserNameModel model) { try { var username = this.accountService.ForgotUserName(model); if (username != null) { return PartialView(Views.UserName._ForgotUserNameSuccess, model); } } catch (Exception x) { ModelState.AddModelError("", "We had a problem sending your user name. Please contact us through the help page."); this.emailHelper.SendErrorEmail(x as Exception); } return PartialView(Views.UserName._ForgotUserName, model); }