From 124523ad8862d7b3341599d178882febd27d12a9 Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 4 Sep 2025 17:46:16 +0200 Subject: [PATCH] configure attributes --- .../Handlers/SendSignedMailHandler.cs | 21 ++---------- .../Notifications/SendMailHandler.cs | 32 +++++++++++++++++-- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/EnvelopeGenerator.Application/Notifications/DocSigned/Handlers/SendSignedMailHandler.cs b/EnvelopeGenerator.Application/Notifications/DocSigned/Handlers/SendSignedMailHandler.cs index eb06c026..15f507a5 100644 --- a/EnvelopeGenerator.Application/Notifications/DocSigned/Handlers/SendSignedMailHandler.cs +++ b/EnvelopeGenerator.Application/Notifications/DocSigned/Handlers/SendSignedMailHandler.cs @@ -34,7 +34,6 @@ public class SendSignedMailHandler : SendMailHandler } /// - /// /// /// /// @@ -42,26 +41,10 @@ public class SendSignedMailHandler : SendMailHandler { var placeHolders = new Dictionary() { + { "[NAME_RECEIVER]", notification.Name ?? string.Empty }, + { "[DOCUMENT_TITLE]", notification.Envelope?.Title ?? string.Empty }, }; return placeHolders; } - - private static string TextToHtml(string input) - { - if (string.IsNullOrEmpty(input)) return ""; - - // HTML encoding special characters - string encoded = System.Net.WebUtility.HtmlEncode(input); - - // Convert tabs to   (4 non-breaking spaces) - encoded = encoded.Replace("\t", "    "); - - // Convert line breaks to
- encoded = encoded.Replace("\r\n", "
"); // Windows - encoded = encoded.Replace("\r", "
"); // Mac old - encoded = encoded.Replace("\n", "
"); // Unix/Linux - - return encoded; - } } \ No newline at end of file diff --git a/EnvelopeGenerator.Application/Notifications/SendMailHandler.cs b/EnvelopeGenerator.Application/Notifications/SendMailHandler.cs index fe12dc77..eb327be8 100644 --- a/EnvelopeGenerator.Application/Notifications/SendMailHandler.cs +++ b/EnvelopeGenerator.Application/Notifications/SendMailHandler.cs @@ -48,7 +48,14 @@ public abstract class SendMailHandler : INotificationHandler CreatePlaceHolders(TNotification notification); /// - /// + ///{ "[MESSAGE]", notification.Message },
+ ///{ "[DOCUMENT_ACCESS_CODE]", notification.ReceiverAccessCode },
+ ///{ "[REASON]", pReason }
+ ///{ "[NAME_SENDER]", notification.Envelope.User?.FullName},
+ ///{ "[NAME_PORTAL]", DispatcherParams. },
+ ///{ "[SIGNATURE_TYPE]", "signieren" },
+ ///{ "[LINK_TO_DOCUMENT]", notification.SignatureLink },
+ ///{ "[LINK_TO_DOCUMENT_TEXT]", $"{notification.SignatureLink.Truncate(40)}.." }, ///
protected readonly MailParams MailParams; @@ -89,6 +96,7 @@ public abstract class SendMailHandler : INotificationHandler x.Name == notification.TemplateType.ToString(), cancel) @@ -102,7 +110,7 @@ public abstract class SendMailHandler : INotificationHandler : INotificationHandler + encoded = encoded.Replace("\r\n", "
"); // Windows + encoded = encoded.Replace("\r", "
"); // Mac old + encoded = encoded.Replace("\n", "
"); // Unix/Linux + + return encoded; + } +} \ No newline at end of file