add application name as metadata to mail message
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Net.Mail;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace zero.Mails;
|
||||
@@ -76,6 +77,9 @@ public class MailProvider : IMailProvider
|
||||
message.BodyEncoding = encoding;
|
||||
message.Preheader = TokenReplacement.Apply(message.Preheader, message.Placeholders);
|
||||
|
||||
string appName = Zero.Options.AppName.Or(Assembly.GetEntryAssembly()?.GetName().Name);
|
||||
message.Metadata.Add("application", appName);
|
||||
|
||||
if (!message.HasView || message.Body.HasValue())
|
||||
{
|
||||
message.IsRendered = true;
|
||||
|
||||
Reference in New Issue
Block a user