only allow notification if smtp server is setup.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-14 12:13:37 -07:00
parent 7122f4ac0d
commit 6e5cfde2cf
3 changed files with 20 additions and 2 deletions

View File

@@ -20,6 +20,10 @@ namespace CarCareTracker.Helper
}
public OperationResponse NotifyUserForRegistration(string emailAddress, string token)
{
if (string.IsNullOrWhiteSpace(mailConfig.EmailServer))
{
return new OperationResponse { Success = false, Message = "SMTP Server Not Setup" };
}
if (string.IsNullOrWhiteSpace(emailAddress) || string.IsNullOrWhiteSpace(token)) {
return new OperationResponse { Success = false, Message = "Email Address or Token is invalid" };
}
@@ -36,6 +40,10 @@ namespace CarCareTracker.Helper
}
public OperationResponse NotifyUserForPasswordReset(string emailAddress, string token)
{
if (string.IsNullOrWhiteSpace(mailConfig.EmailServer))
{
return new OperationResponse { Success = false, Message = "SMTP Server Not Setup" };
}
if (string.IsNullOrWhiteSpace(emailAddress) || string.IsNullOrWhiteSpace(token))
{
return new OperationResponse { Success = false, Message = "Email Address or Token is invalid" };