fixed incorrect validation checking on mail configuration

This commit is contained in:
Mia Rose Winter 2024-02-19 15:20:56 +01:00
parent dcb70897ca
commit c53dd72b2a
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

View file

@ -150,7 +150,7 @@
if (emailConfig.Smtp.Keys.Any(k => k.Equals("bulk", StringComparison.CurrentCultureIgnoreCase))) {
builder.Services.AddScoped<NewsletterBackgroundService>();
builder.Services.AddHostedService<EmailBackgroundWorker>();
} else if (builder.Configuration.GetSection(nameof(Features)).Get<Features>()?.EmailSubscriptions is not true) {
} else if (builder.Configuration.GetSection(nameof(Features)).Get<Features>()?.EmailSubscriptions is true) {
throw new ApplicationException(
"Email subscriptions have been enabled, but no 'bulk' email provider was configured. " +
"Disable email subscriptions or provide the mail provider for bulk sending");