From 573ad84fd81c4252ba30883933c9b8ebf48ab6a1 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Thu, 26 May 2016 09:01:47 +0100 Subject: [PATCH] Fixed #240 --- .../Notification/EmailMessageNotification.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/PlexRequests.Services/Notification/EmailMessageNotification.cs b/PlexRequests.Services/Notification/EmailMessageNotification.cs index f2217dc7e..20ef3f612 100644 --- a/PlexRequests.Services/Notification/EmailMessageNotification.cs +++ b/PlexRequests.Services/Notification/EmailMessageNotification.cs @@ -62,7 +62,10 @@ namespace PlexRequests.Services.Notification var emailSettings = (EmailNotificationSettings)settings; - if (!ValidateConfiguration(emailSettings)) return; + if (!ValidateConfiguration(emailSettings)) + { + return; + } switch (model.NotificationType) { @@ -96,13 +99,17 @@ namespace PlexRequests.Services.Notification private bool ValidateConfiguration(EmailNotificationSettings settings) { - if (!settings.Enabled) + if (string.IsNullOrEmpty(settings.EmailHost) || string.IsNullOrEmpty(settings.EmailUsername) || string.IsNullOrEmpty(settings.EmailPassword) || string.IsNullOrEmpty(settings.RecipientEmail) || string.IsNullOrEmpty(settings.EmailPort.ToString())) { return false; } - if (string.IsNullOrEmpty(settings.EmailHost) || string.IsNullOrEmpty(settings.EmailUsername) || string.IsNullOrEmpty(settings.EmailPassword) || string.IsNullOrEmpty(settings.RecipientEmail) || string.IsNullOrEmpty(settings.EmailPort.ToString())) + + if (!settings.EnableUserEmailNotifications) { - return false; + if (!settings.Enabled) + { + return false; + } } return true;