Merge pull request #4686 from sbwalker/dev
add validation of recipient email address to Notification job
This commit is contained in:
commit
e5d8c02def
|
@ -89,9 +89,9 @@ namespace Oqtane.Infrastructure
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate recipient
|
// validate recipient
|
||||||
if (string.IsNullOrEmpty(notification.ToEmail))
|
if (string.IsNullOrEmpty(notification.ToEmail) || !MailAddress.TryCreate(notification.ToEmail, out _))
|
||||||
{
|
{
|
||||||
log += "Recipient Missing For NotificationId: " + notification.NotificationId + "<br />";
|
log += $"NotificationId: {notification.NotificationId} - Has Missing Or Invalid Recipient {notification.ToEmail}<br />";
|
||||||
notification.IsDeleted = true;
|
notification.IsDeleted = true;
|
||||||
notificationRepository.UpdateNotification(notification);
|
notificationRepository.UpdateNotification(notification);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user