Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class CustomChecksMailNotification : IDomainHandler<CustomCheckFailed>, IDomainH
"ServiceControl database",
"ServiceControl Remotes",
"Error Message Ingestion Process",
"Audit Message Ingestion",
"Error Message Ingestion"
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ public async Task Handle(SendEmailNotification message, IMessageHandlerContext c
notifications = await manager.LoadSettings(cacheTimeout);
}

logger.LogInformation("Processing email notification. Subject: {Subject}, Body: {Body}", message.Subject, message.Body);

if (notifications == null || !notifications.Email.Enabled)
{
logger.LogInformation("Skipping email sending. Notifications turned-off");
logger.LogDebug("Skipping email sending. Notifications turned-off");
return;
}

Expand All @@ -57,8 +59,7 @@ public async Task Handle(SendEmailNotification message, IMessageHandlerContext c

if (context.MessageId == throttlingState.RetriedMessageId)
{
message.Body +=
"\n\nWARNING: Your SMTP server was temporarily unavailable. Make sure to check ServicePulse for a full list of health check notifications.";
message.Body += "\n\nWARNING: Your SMTP server was temporarily unavailable. Make sure to check ServicePulse for a full list of health check notifications.";
}

await emailSender.Send(notifications.Email, message.Subject, message.Body, emailDropFolder);
Expand Down