Updated references from `Constants` to direct usage of `EnvelopeStatus` and `EmailTemplateType` enums. This change enhances code readability and reduces dependency on the `Constants` class. Modified properties and parameters across command classes, DTOs, repositories, and services to use the enums directly. Updated `ModifyDocStatusCommandBase`, `EnvelopeHistoryDto`, and `ResetEmailTemplateCommand` for improved clarity. Consistent updates across multiple files indicate a systematic refactoring aimed at streamlining the codebase and improving maintainability. Comments and documentation have also been revised to reflect these changes.
84 lines
3.1 KiB
VB.net
84 lines
3.1 KiB
VB.net
Imports EnvelopeGenerator.CommonServices.EnvelopeGenerator.Domain.Entities
|
|
Imports EnvelopeGenerator.Domain
|
|
Imports EnvelopeGenerator.Domain.Entities
|
|
Public Class EmailData
|
|
Public Property EmailAdress As String = ""
|
|
Public Property EmailSubject As String = ""
|
|
Public Property EmailBody As String = ""
|
|
Public Property EmailType As EnvelopeStatus = EnvelopeStatus.Invalid
|
|
Public Property ReferenceID As Integer = 0
|
|
Public Property ReferenceString As String = ""
|
|
|
|
Public Property ReceiverAccessCode As String = ""
|
|
Public Property ReceiverName As String = ""
|
|
Public Property SenderName As String = ""
|
|
Public Property SenderAdress As String = ""
|
|
|
|
Public Property SignatureLink As String = ""
|
|
Public Property Message As String = ""
|
|
Public Property EnvelopeTitle As String = ""
|
|
|
|
Public Property EmailAttachment As String = ""
|
|
Public Property ATT1_RELATED_ID As Long
|
|
Public Property ATT1_REL_TYPE As String = ""
|
|
Public Property ADDED_WHO_PROCESS As String = "DDEnvelopGenerator"
|
|
|
|
''' <summary>
|
|
''' Constructor for sending email to receiver
|
|
''' </summary>
|
|
''' <param name="pEnvelope"></param>
|
|
''' <param name="pReceiver"></param>
|
|
''' <param name="pStatus"></param>
|
|
Public Sub New(pEnvelope As Entities.Envelope, pReceiver As ReceiverVM, pStatus As EnvelopeStatus)
|
|
EmailAdress = pReceiver.EmailAddress
|
|
EmailSubject = String.Empty
|
|
EmailType = pStatus
|
|
|
|
Message = TextToHtml(pEnvelope.Message)
|
|
ReferenceID = pEnvelope.Id
|
|
ReferenceString = pEnvelope.Uuid
|
|
ReceiverName = pReceiver.Name
|
|
ReceiverAccessCode = pReceiver.AccessCode
|
|
SenderAdress = pEnvelope.User.Email
|
|
SenderName = pEnvelope.User.GetFullName()
|
|
EnvelopeTitle = pEnvelope.Title
|
|
End Sub
|
|
Public Function TextToHtml(input As String) As String
|
|
If String.IsNullOrEmpty(input) Then Return ""
|
|
|
|
' HTML-Encodierung der Sonderzeichen
|
|
Dim encoded As String = System.Net.WebUtility.HtmlEncode(input)
|
|
|
|
' Tabs in umwandeln (z.B. 4 non-breaking spaces)
|
|
encoded = encoded.Replace(vbTab, " ")
|
|
|
|
' Zeilenumbrüche in <br /> umwandeln
|
|
encoded = encoded.Replace(vbCrLf, "<br />") ' Windows
|
|
encoded = encoded.Replace(vbCr, "<br />") ' Mac alt
|
|
encoded = encoded.Replace(vbLf, "<br />") ' Unix/Linux
|
|
|
|
Return encoded
|
|
End Function
|
|
|
|
''' <summary>
|
|
''' Constructor for sending email to creator
|
|
''' </summary>
|
|
''' <param name="pEnvelope"></param>
|
|
''' <param name="pStatus"></param>
|
|
Public Sub New(pEnvelope As Entities.Envelope, pStatus As EnvelopeStatus)
|
|
EmailAdress = pEnvelope.User.Email
|
|
EmailSubject = String.Empty
|
|
EmailType = pStatus
|
|
|
|
Message = pEnvelope.Message
|
|
ReferenceID = pEnvelope.Id
|
|
ReferenceString = pEnvelope.Uuid
|
|
ReceiverName = pEnvelope.User.GetFullName()
|
|
ReceiverAccessCode = String.Empty
|
|
SenderAdress = pEnvelope.User.Email
|
|
SenderName = pEnvelope.User.GetFullName()
|
|
EnvelopeTitle = pEnvelope.Title
|
|
End Sub
|
|
|
|
End Class
|