EmailMessage log extension fix

master
Tudor Stanciu 2023-01-21 13:51:21 +02:00
parent 826bee7db6
commit 3a8ddce394
1 changed files with 8 additions and 1 deletions

View File

@ -9,6 +9,13 @@ namespace Correo.Abstractions.Extensions
=> addresses != null ? string.Join(',', addresses.Select(z => z.Address)) : string.Empty;
public static string Log(this EmailMessage message)
=> $"Email sent: Subject: {message.Subject}; From: {message.From.Address}; To: {message.To.Log()}; Cc: {message.Cc.Log()}; Bcc: {message.Bcc.Log()};";
{
var msg = $"Email sent: Subject: {message.Subject}; From: {message.From.Address}; To: {message.To.Log()};";
if (message.Cc != null)
msg += $" Cc: {message.Cc.Log()};";
if (message.Bcc != null)
msg += $" Bcc: {message.Bcc.Log()};";
return msg;
}
}
}