Cleaned up config for Content settings

This commit is contained in:
Bjarke Berg
2020-03-12 15:30:22 +01:00
parent cb0994a929
commit c486444eda
73 changed files with 279 additions and 351 deletions

View File

@@ -18,9 +18,9 @@ namespace Umbraco.Web.HealthCheck.NotificationMethods
private readonly IRuntimeState _runtimeState;
private readonly ILogger _logger;
private readonly IGlobalSettings _globalSettings;
private readonly IUmbracoSettingsSection _umbracoSettingsSection;
private readonly IContentSettings _contentSettings;
public EmailNotificationMethod(ILocalizedTextService textService, IRuntimeState runtimeState, ILogger logger, IGlobalSettings globalSettings, IHealthChecks healthChecks, IUmbracoSettingsSection umbracoSettingsSection) : base(healthChecks)
public EmailNotificationMethod(ILocalizedTextService textService, IRuntimeState runtimeState, ILogger logger, IGlobalSettings globalSettings, IHealthChecks healthChecks, IContentSettings contentSettings) : base(healthChecks)
{
var recipientEmail = Settings["recipientEmail"]?.Value;
if (string.IsNullOrWhiteSpace(recipientEmail))
@@ -35,7 +35,7 @@ namespace Umbraco.Web.HealthCheck.NotificationMethods
_runtimeState = runtimeState;
_logger = logger;
_globalSettings = globalSettings;
_umbracoSettingsSection = umbracoSettingsSection ?? throw new ArgumentNullException(nameof(umbracoSettingsSection));
_contentSettings = contentSettings ?? throw new ArgumentNullException(nameof(contentSettings));
}
public string RecipientEmail { get; }
@@ -74,7 +74,7 @@ namespace Umbraco.Web.HealthCheck.NotificationMethods
private MailMessage CreateMailMessage(string subject, string message)
{
var to = _umbracoSettingsSection.Content.NotificationEmailAddress;
var to = _contentSettings.NotificationEmailAddress;
if (string.IsNullOrWhiteSpace(subject))
subject = "Umbraco Health Check Status";