Merge pull request #4615 from sephrat/test-email-message

Better error message when test email fails due to missing recipient [skip ci]
pull/4621/head
Jamie 3 years ago committed by GitHub
commit d8e831de91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -282,11 +282,18 @@ namespace Ombi.Controllers.V1.External
{ {
try try
{ {
var currentUser = await GetCurrentUserAsync();
if (!currentUser.Email.HasValue())
{
throw new Exception($"User '{currentUser.UserName}' has no email address set on their user profile.");
}
var message = new NotificationMessage var message = new NotificationMessage
{ {
Message = "This is just a test! Success!", Message = "This is just a test! Success!",
Subject = $"Ombi: Test", Subject = $"Ombi: Test",
To = (await GetCurrentUserAsync()).Email, To = currentUser.Email,
}; };
message.Other.Add("PlainTextBody", "This is just a test! Success!"); message.Other.Add("PlainTextBody", "This is just a test! Success!");

Loading…
Cancel
Save