- Welcome, please use the form to sign-in.
+Welcome, please use the form to sign-in.
+
+ Verifying your password reset link, please wait...
+ } + + + @if (state === 'invalid') { + + + ← Back to Sign In + } + + + @if (state === 'form') { +Set a new password for {{ userName || loginID }}@if (userName && loginID) { ({{ loginID }})}.
+ + + } + + + @if (state === 'done') { + + + } +User Log-in ID : " + employeeId + "
"; - mailSender.Body += "Password : " + password + "
"; - mailSender.SendMail(emailSettings); - System.Threading.Thread.Sleep(500); + mailSender.Subject = "Reset your HR software password (Do not reply to this mail)"; + mailSender.Body = this.GetResetPasswordMailBody(user, resetLink, expiryMinutes); + + // SendMail(settings, "") reports failure (returns false) instead of swallowing it + if (!mailSender.SendMail(_emailSettings.Value, string.Empty)) + { + return StatusCode(StatusCodes.Status500InternalServerError, + "Could not send the email. Please check the email settings or try again later."); + } + + return Ok(new { maskedEmail = MaskEmail(emailAddress), expiryMinutes = expiryMinutes }); + } + catch (Exception e) + { + return StatusCode(StatusCodes.Status500InternalServerError, e.Message); + } + } + + ///Dear " + name + ",
" + + "We received a request to reset the password of your HR software account " + + "(Login ID: " + loginId + ").
" + + "Please click the button below to set a new password. This link will expire in " + + expiryMinutes + " minutes and can be used only once.
" + + "" + + "If the button does not work, copy and paste this link into your browser:
"
+ + "" + link + "
If you did not request a password reset, please ignore this email. Your password will not be changed.
" + + "
This is a system generated mail, Please do not reply.