merge placeholders dictionary

This commit is contained in:
tekh 2025-09-04 16:45:56 +02:00
parent 1b7a42fd7e
commit 95fe1aefcf

View File

@ -45,7 +45,7 @@ public abstract class SendMailHandler<TNotification> : INotificationHandler<TNot
/// <summary>
///
/// </summary>
protected virtual Dictionary<string, string> BodyPlaceHolders { get; } = new();
protected virtual Dictionary<string, string> PlaceHolders { get; } = new();
/// <summary>
///
@ -57,11 +57,6 @@ public abstract class SendMailHandler<TNotification> : INotificationHandler<TNot
/// </summary>
protected readonly DispatcherParams DispatcherParams;
/// <summary>
///
/// </summary>
protected virtual Dictionary<string, string> SubjectPlaceHolders { get; } = new();
/// <summary>
///
/// </summary>
@ -99,9 +94,9 @@ public abstract class SendMailHandler<TNotification> : INotificationHandler<TNot
?? throw new InvalidOperationException($"Receiver information is missing in the notification." +
$"{typeof(TNotification)}:\n {JsonConvert.SerializeObject(notification, Format.Json.ForDiagnostics)}");
temp.Subject = ReplacePlaceHolders(temp.Subject, SubjectPlaceHolders, MailParams.Placeholders);
temp.Subject = ReplacePlaceHolders(temp.Subject, PlaceHolders, MailParams.Placeholders);
temp.Body = ReplacePlaceHolders(temp.Body, BodyPlaceHolders, MailParams.Placeholders);
temp.Body = ReplacePlaceHolders(temp.Body, PlaceHolders, MailParams.Placeholders);
var emailOut = new EmailOut
{