remove cancelation token from ConfigEmailOut

This commit is contained in:
tekh 2025-09-04 16:41:26 +02:00
parent 73da768ed3
commit 1b7a42fd7e
3 changed files with 22 additions and 22 deletions

View File

@ -27,9 +27,27 @@ public class SendSignedMailHandler : SendMailHandler<DocSignedNotification>
/// </summary> /// </summary>
/// <param name="notification"></param> /// <param name="notification"></param>
/// <param name="emailOut"></param> /// <param name="emailOut"></param>
/// <param name="cancel"></param> protected override void ConfigEmailOut(DocSignedNotification notification, EmailOut emailOut)
protected override void ConfigEmailOut(DocSignedNotification notification, EmailOut emailOut, CancellationToken cancel)
{ {
emailOut.ReferenceString = notification.EmailAddress; emailOut.ReferenceString = notification.EmailAddress;
emailOut.ReferenceId = notification.ReceiverId;
} }
}
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 &nbsp; (4 non-breaking spaces)
encoded = encoded.Replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;");
// Convert line breaks to <br />
encoded = encoded.Replace("\r\n", "<br />"); // Windows
encoded = encoded.Replace("\r", "<br />"); // Mac old
encoded = encoded.Replace("\n", "<br />"); // Unix/Linux
return encoded;
}
}

View File

@ -127,22 +127,4 @@ public abstract class SendMailHandler<TNotification> : INotificationHandler<TNot
text = text.Replace(ph.Key, ph.Value); text = text.Replace(ph.Key, ph.Value);
return text; return text;
} }
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 &nbsp; (4 non-breaking spaces)
encoded = encoded.Replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;");
// Convert line breaks to <br />
encoded = encoded.Replace("\r\n", "<br />"); // Windows
encoded = encoded.Replace("\r", "<br />"); // Mac old
encoded = encoded.Replace("\n", "<br />"); // Unix/Linux
return encoded;
}
} }

View File

@ -27,7 +27,7 @@
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.0" /> <PackageReference Include="NLog.Web.AspNetCore" Version="5.3.0" />
<PackageReference Include="Scalar.AspNetCore" Version="2.2.1" /> <PackageReference Include="Scalar.AspNetCore" Version="2.2.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="8.1.1" />
<PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction" Version="3.1.1" /> <PackageReference Include="DigitalData.EmailProfilerDispatcher.Abstraction" Version="3.2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'"> <ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">