Skip to content

Commit 0ae2d64

Browse files
authored
Log email notification subject and body for all SendEmailNotificationHandler executions (#5139)
* remove duplicate custom check - Audit Message Ingestion * add email notification subject and body to log * apply code review suggestions
1 parent d794df8 commit 0ae2d64

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ServiceControl/Notifications/Email/CustomChecksMailNotification.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class CustomChecksMailNotification : IDomainHandler<CustomCheckFailed>, IDomainH
2525
"ServiceControl database",
2626
"ServiceControl Remotes",
2727
"Error Message Ingestion Process",
28-
"Audit Message Ingestion",
2928
"Error Message Ingestion"
3029
};
3130

src/ServiceControl/Notifications/Email/SendEmailNotificationHandler.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ public async Task Handle(SendEmailNotification message, IMessageHandlerContext c
3232
notifications = await manager.LoadSettings(cacheTimeout);
3333
}
3434

35+
logger.LogInformation("Processing email notification. Subject: {Subject}, Body: {Body}", message.Subject, message.Body);
36+
3537
if (notifications == null || !notifications.Email.Enabled)
3638
{
37-
logger.LogInformation("Skipping email sending. Notifications turned-off");
39+
logger.LogDebug("Skipping email sending. Notifications turned-off");
3840
return;
3941
}
4042

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

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

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

0 commit comments

Comments
 (0)