diff --git a/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs b/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs index 71ea84f1adad..7799fec5eacd 100644 --- a/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/GlobalSettings.cs @@ -157,11 +157,6 @@ public class GlobalSettings /// public bool IsSmtpServerConfigured => !string.IsNullOrWhiteSpace(Smtp?.Host); - /// - /// Gets a value indicating whether there is a physical pickup directory configured. - /// - public bool IsPickupDirectoryLocationConfigured => !string.IsNullOrWhiteSpace(Smtp?.PickupDirectoryLocation); - /// /// An int value representing the time in milliseconds to lock the database for a write operation /// diff --git a/src/Umbraco.Infrastructure/Mail/EmailSender.cs b/src/Umbraco.Infrastructure/Mail/EmailSender.cs index 49dc669bb680..4ca3506fa97c 100644 --- a/src/Umbraco.Infrastructure/Mail/EmailSender.cs +++ b/src/Umbraco.Infrastructure/Mail/EmailSender.cs @@ -75,13 +75,15 @@ private async Task SendAsyncInternal(EmailMessage message, string emailType, boo } } - if (!_globalSettings.IsSmtpServerConfigured && !_globalSettings.IsPickupDirectoryLocationConfigured) + var isPickupDirectoryConfigured = !string.IsNullOrWhiteSpace(_globalSettings.Smtp?.PickupDirectoryLocation); + + if (_globalSettings.IsSmtpServerConfigured == false && !isPickupDirectoryConfigured) { _logger.LogDebug("Could not send email for {Subject}. It was not handled by a notification handler and there is no SMTP configured.", message.Subject); return; } - if (_globalSettings.IsPickupDirectoryLocationConfigured && !string.IsNullOrWhiteSpace(_globalSettings.Smtp?.From)) + if (isPickupDirectoryConfigured && !string.IsNullOrWhiteSpace(_globalSettings.Smtp?.From)) { // The following code snippet is the recommended way to handle PickupDirectoryLocation. // See more https://github.com/jstedfast/MailKit/blob/master/FAQ.md#q-how-can-i-send-email-to-a-specifiedpickupdirectory @@ -152,10 +154,7 @@ await client.ConnectAsync(_globalSettings.Smtp.Host, /// /// /// We assume this is possible if either an event handler is registered or an smtp server is configured - /// or a pickup directory location is configured /// - public bool CanSendRequiredEmail() => _globalSettings.IsSmtpServerConfigured - || _globalSettings.IsPickupDirectoryLocationConfigured - || _notificationHandlerRegistered; + public bool CanSendRequiredEmail() => _globalSettings.IsSmtpServerConfigured || _notificationHandlerRegistered; } }