Added the check before sending mail when adding application access to employee
This commit is contained in:
parent
824381bb49
commit
7659eadd00
@ -1181,11 +1181,14 @@ namespace MarcoBMS.Services.Controllers
|
|||||||
|
|
||||||
// Prepare reset link sender helper
|
// Prepare reset link sender helper
|
||||||
private async Task SendResetIfApplicableAsync(ApplicationUser u, string firstName)
|
private async Task SendResetIfApplicableAsync(ApplicationUser u, string firstName)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(u.Email))
|
||||||
{
|
{
|
||||||
var token = await _userManager.GeneratePasswordResetTokenAsync(u);
|
var token = await _userManager.GeneratePasswordResetTokenAsync(u);
|
||||||
var resetLink = $"{_configuration["AppSettings:WebFrontendUrl"]}/reset-password?token={WebUtility.UrlEncode(token)}";
|
var resetLink = $"{_configuration["AppSettings:WebFrontendUrl"]}/reset-password?token={WebUtility.UrlEncode(token)}";
|
||||||
await _emailSender.SendResetPasswordEmailOnRegister(u.Email ?? "", firstName, resetLink);
|
await _emailSender.SendResetPasswordEmailOnRegister(u.Email, firstName, resetLink);
|
||||||
_logger.LogInfo("Reset password email queued. Email={Email}", u.Email ?? "");
|
_logger.LogInfo("Reset password email queued. Email={Email}", u.Email);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user