Merge pull request #839 from hargata/Hargata/805

re-send registration token email.
This commit is contained in:
Hargata Softworks
2025-02-03 08:51:21 -07:00
committed by GitHub

View File

@@ -321,7 +321,18 @@ namespace CarCareTracker.Logic
var existingToken = _tokenData.GetTokenRecordByEmailAddress(emailAddress);
if (existingToken.Id != default)
{
return OperationResponse.Failed("There is an existing token tied to this email address");
if (autoNotify) //re-send email
{
var notificationResult = _mailHelper.NotifyUserForRegistration(emailAddress, existingToken.Body);
if (notificationResult.Success)
{
return OperationResponse.Failed($"There is an existing token tied to {emailAddress}, a new email has been sent out");
} else
{
return notificationResult;
}
}
return OperationResponse.Failed($"There is an existing token tied to {emailAddress}");
}
var token = new Token()
{