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.
This commit is contained in:
@@ -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
|
||||
@@ -20,11 +22,20 @@ Public Class TemplateService
|
||||
Private Sub InitDictionary(pEmailData As EmailData, Optional pReason As String = "")
|
||||
Logger.Debug("Initializing dictionary..")
|
||||
|
||||
Dim signatureType As String
|
||||
If pEmailData.EnvelopeTypeId = 1 Then
|
||||
signatureType = "Signieren"
|
||||
pEmailData.Message = "Bitte lesen und unterzeichnen Sie dieses Dokument."
|
||||
ElseIf pEmailData.EnvelopeTypeId = 2 Then
|
||||
signatureType = "Lesen und bestätigen"
|
||||
pEmailData.Message = "Bitte lesen und bestätigen Sie, dieses Dokument gelesen zu haben."
|
||||
End If
|
||||
|
||||
_replaceDictionary = New Dictionary(Of String, String) From {
|
||||
{"[NAME_RECEIVER]", pEmailData.ReceiverName},
|
||||
{"[NAME_SENDER]", pEmailData.SenderName},
|
||||
{"[NAME_PORTAL]", DbConfig.ExternalProgramName},
|
||||
{"[SIGNATURE_TYPE]", "signieren"},
|
||||
{"[SIGNATURE_TYPE]", signatureType},
|
||||
{"[LINK_TO_DOCUMENT]", pEmailData.SignatureLink},
|
||||
{"[LINK_TO_DOCUMENT_TEXT]", $"{pEmailData.SignatureLink.Truncate(40)}.."},
|
||||
{"[DOCUMENT_TITLE]", pEmailData.EnvelopeTitle},
|
||||
|
||||
Reference in New Issue
Block a user