diff --git a/Console/BExIS.Web.Shell/Controllers/AccountController.cs b/Console/BExIS.Web.Shell/Controllers/AccountController.cs index 8c61d78cb..58baa66b6 100644 --- a/Console/BExIS.Web.Shell/Controllers/AccountController.cs +++ b/Console/BExIS.Web.Shell/Controllers/AccountController.cs @@ -218,7 +218,32 @@ public async Task ForgotPassword(ForgotPasswordViewModel model) var code = await identityUserService.GeneratePasswordResetTokenAsync(user.Id); var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code }, Request.Url.Scheme); - await identityUserService.SendEmailAsync(user.Id, "Reset Password", "Please reset your password by clicking here"); + + // Create professional email template + var displayName = !string.IsNullOrEmpty(user.DisplayName) ? user.DisplayName : user.UserName; + var applicationName = BExIS.Utils.Config.GeneralSettings.ApplicationName; + if (string.IsNullOrEmpty(applicationName)) applicationName = "BEXIS2"; + + var emailBody = $@" + + +

Dear {displayName},

+ +

We received a request to reset the password for your account.

+

If you made this request, please reset your password by following the secure link below:

+ +

+ Reset your password +

+ +

If you did not request a password reset, you can safely ignore this message. Your account will remain unchanged.

+ +

Best regards,
+ Your {applicationName} Support Team

+ + "; + + await identityUserService.SendEmailAsync(user.Id, "Reset Password", emailBody); return RedirectToAction("ForgotPasswordConfirmation", "Account"); } finally diff --git a/Console/BExIS.Web.Shell/Views/Account/ForgotPasswordConfirmation.cshtml b/Console/BExIS.Web.Shell/Views/Account/ForgotPasswordConfirmation.cshtml index 0a9e27ce3..f862aa490 100644 --- a/Console/BExIS.Web.Shell/Views/Account/ForgotPasswordConfirmation.cshtml +++ b/Console/BExIS.Web.Shell/Views/Account/ForgotPasswordConfirmation.cshtml @@ -1,10 +1,10 @@ @{ - ViewBag.Title = "Forgot Password Confirmation"; + ViewBag.Title = "Password Reset Request Submitted"; } @section Information { - Just check your mails. If you are not receiving any mail from us, just try it again and/or check your junk/spam folder. + If an account with your email exists, we've sent instructions to reset your password. Please check your inbox (and your spam folder). }
@@ -12,6 +12,6 @@

- Please check your email to reset your password. + If an account with your email exists, we've sent instructions to reset your password. Please check your inbox (and your spam folder).

\ No newline at end of file