Пример #1
0
        public ActionResult RecoverPassword(RecoverPasswordViewModel model)
        {
            try
            {
                var lostPassword = customerAccountService.RecoverPassword(model.Email);
                var customer     = customerAccountService.GetCustomerByEmail(model.Email);
                mailer.RecoverPassword(customer.FirstName + " " + customer.LastName, model.Email, lostPassword).Send();

                return(View("RecoverPasswordSuccess", (object)model.Email));
            }
            catch (Exception ex)
            {
                model.HasError     = true;
                model.ErrorMessage = ex.Message;
                return(View(model));
            }
        }