diff --git a/nebula-logger/core/main/log-management/classes/LoggerEmailSender.cls b/nebula-logger/core/main/log-management/classes/LoggerEmailSender.cls index 0d8bc0ad8..03b4c050d 100644 --- a/nebula-logger/core/main/log-management/classes/LoggerEmailSender.cls +++ b/nebula-logger/core/main/log-management/classes/LoggerEmailSender.cls @@ -118,17 +118,17 @@ public without sharing class LoggerEmailSender { } private static void sendEmail(Messaging.SingleEmailMessage message) { + SENT_EMAILS.add(message); if (IS_EMAIL_DELIVERABILITY_ENABLED == true) { List messages = new List{ message }; List emailResults = Messaging.sendEmail(messages); - SENT_EMAILS.add(message); if (LoggerParameter.ENABLE_SYSTEM_MESSAGES == false) { return; } else if (emailResults.get(0).success == true) { Logger.info('Logger - The email was sent successfully'); } else { - Logger.info('Logger - The email failed to send: ' + emailResults.get(0).errors.get(0).message); + Logger.warn('Logger - The email failed to send: ' + emailResults.get(0).errors.get(0).message); } } }