Compare commits

...

5 Commits

Author SHA1 Message Date
OlgunR
4335a500f1 Update envelope type 2 confirmation message
Revised the message for envelope type 2 to improve clarity. The new text now asks users to confirm they have read the document, removing the previous instruction to read and confirm.
2026-03-04 09:33:29 +01:00
OlgunR
0e2c653784 Refactor SignatureLinkText to DocumentProcess property
Replaced SignatureLinkText with DocumentProcess in EmailData and updated all references. Adjusted DynamicStringsForEmails logic and template replacements accordingly. Added debug logging for template replacements. Bumped assembly version to 2.7.1.0.
2026-03-04 09:30:29 +01:00
OlgunR
92d88812e8 Add SignatureLinkText to EmailData and template support
Introduced SignatureLinkText property in EmailData to hold signature-related text, set dynamically based on envelope type. Updated constructor to HTML-encode SignatureLinkText. Added [SIGNATURE_LINK_TEXT] to template dictionary in TemplateService for email customization.
2026-03-03 12:44:54 +01:00
OlgunR
af60dfe338 Refactor email content logic into EmailData class
Move dynamic message and signature type logic from TemplateService to EmailData via DynamicStringsForEmails. Constructors now set and HTML-encode these properties. Improves maintainability by centralizing email content generation.
2026-03-03 10:42:18 +01:00
OlgunR
a7fff24f80 Add EnvelopeTypeId to EmailData and dynamic signature type
Introduced EnvelopeTypeId as a read-only property in EmailData, set during construction. Updated TemplateService.InitDictionary to use EnvelopeTypeId for determining signature type and message content, replacing the hardcoded [SIGNATURE_TYPE] value. Also added necessary imports for domain entities and constants.
2026-03-03 09:19:18 +01:00
3 changed files with 39 additions and 7 deletions

View File

@@ -22,6 +22,23 @@ Public Class EmailData
Public Property ATT1_REL_TYPE As String = ""
Public Property ADDED_WHO_PROCESS As String = "DDEnvelopGenerator"
Public ReadOnly Property EnvelopeTypeId As Integer = 0
Public Property SignatureType As String = ""
Public Property DocumentProcess As String = ""
Public Sub DynamicStringsForEmails(pEnvelope As Entities.Envelope)
If pEnvelope.EnvelopeTypeId = 1 Then
SignatureType = "Signieren"
Message = "Bitte lesen und unterzeichnen Sie dieses Dokument."
DocumentProcess = " und elektronisch unterschreiben"
ElseIf pEnvelope.EnvelopeTypeId = 2 Then
SignatureType = "Lesen und bestätigen"
Message = "Bitte bestätigen Sie, dieses Dokument gelesen zu haben."
DocumentProcess = ""
End If
End Sub
''' <summary>
''' Constructor for sending email to receiver
''' </summary>
@@ -29,11 +46,14 @@ Public Class EmailData
''' <param name="pReceiver"></param>
''' <param name="pStatus"></param>
Public Sub New(pEnvelope As Entities.Envelope, pReceiver As Receiver, pStatus As Constants.EnvelopeStatus)
DynamicStringsForEmails(pEnvelope)
EmailAdress = pReceiver.EmailAddress
EmailSubject = String.Empty
EmailType = pStatus
Message = TextToHtml(pEnvelope.Message)
Message = TextToHtml(Message)
ReferenceID = pEnvelope.Id
ReferenceString = pEnvelope.Uuid
ReceiverName = pReceiver.Name
@@ -41,6 +61,9 @@ Public Class EmailData
SenderAdress = pEnvelope.User.Email
SenderName = pEnvelope.User.GetFullName()
EnvelopeTitle = pEnvelope.Title
EnvelopeTypeId = pEnvelope.EnvelopeTypeId
SignatureType = TextToHtml(SignatureType)
DocumentProcess = TextToHtml(DocumentProcess)
End Sub
Public Function TextToHtml(input As String) As String
If String.IsNullOrEmpty(input) Then Return ""
@@ -65,11 +88,14 @@ Public Class EmailData
''' <param name="pEnvelope"></param>
''' <param name="pStatus"></param>
Public Sub New(pEnvelope As Entities.Envelope, pStatus As Constants.EnvelopeStatus)
DynamicStringsForEmails(pEnvelope)
EmailAdress = pEnvelope.User.Email
EmailSubject = String.Empty
EmailType = pStatus
Message = pEnvelope.Message
Message = TextToHtml(Message)
ReferenceID = pEnvelope.Id
ReferenceString = pEnvelope.Uuid
ReceiverName = pEnvelope.User.GetFullName()
@@ -77,6 +103,9 @@ Public Class EmailData
SenderAdress = pEnvelope.User.Email
SenderName = pEnvelope.User.GetFullName()
EnvelopeTitle = pEnvelope.Title
EnvelopeTypeId = pEnvelope.EnvelopeTypeId
SignatureType = TextToHtml(SignatureType)
DocumentProcess = TextToHtml(DocumentProcess)
End Sub
End Class

View File

@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' indem Sie "*" wie unten gezeigt eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.7.0.0")>
<Assembly: AssemblyFileVersion("2.7.0.0")>
<Assembly: AssemblyVersion("2.7.1.0")>
<Assembly: AssemblyFileVersion("2.7.1.0")>

View File

@@ -1,6 +1,8 @@
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Logging
Imports EnvelopeGenerator.CommonServices.My.Resources
Imports EnvelopeGenerator.Domain.Constants
Imports EnvelopeGenerator.Domain.Entities
Public Class TemplateService
Inherits BaseService
@@ -24,13 +26,14 @@ Public Class TemplateService
{"[NAME_RECEIVER]", pEmailData.ReceiverName},
{"[NAME_SENDER]", pEmailData.SenderName},
{"[NAME_PORTAL]", DbConfig.ExternalProgramName},
{"[SIGNATURE_TYPE]", "signieren"},
{"[SIGNATURE_TYPE]", pEmailData.SignatureType},
{"[LINK_TO_DOCUMENT]", pEmailData.SignatureLink},
{"[LINK_TO_DOCUMENT_TEXT]", $"{pEmailData.SignatureLink.Truncate(40)}.."},
{"[DOCUMENT_TITLE]", pEmailData.EnvelopeTitle},
{"[MESSAGE]", pEmailData.Message},
{"[DOCUMENT_ACCESS_CODE]", pEmailData.ReceiverAccessCode},
{"[REASON]", pReason}
{"[REASON]", pReason},
{"[DOCUMENT_PROCESS]", pEmailData.DocumentProcess}
}
End Sub
@@ -79,7 +82,7 @@ Public Class TemplateService
For Each dictItem As KeyValuePair(Of String, String) In _replaceDictionary
If oText.Contains(dictItem.Key) Then
Logger.Debug($"Replacing {dictItem.Key} with {dictItem.Value}")
oText = oText.Replace(dictItem.Key, dictItem.Value)
End If