10.01.2024

This commit is contained in:
Jonathan Jenne
2024-01-10 09:31:04 +01:00
parent b7fbb21076
commit 277f5d3f0d
8 changed files with 148 additions and 27 deletions

View File

@@ -5,17 +5,12 @@ Imports DigitalData.Modules.Logging
Public Class EmailService
Inherits BaseService
Private ReadOnly EnvelopeModel As EnvelopeModel
Private ReadOnly ReceiverModel As ReceiverModel
Private ReadOnly EmailModel As EmailModel
Private ReadOnly EmailTemplate As EmailTemplate
Public Sub New(pState As State)
MyBase.New(pState)
EnvelopeModel = New EnvelopeModel(pState)
ReceiverModel = New ReceiverModel(pState)
EmailModel = New EmailModel(pState)
EmailTemplate = New EmailTemplate(pState)
End Sub
@@ -85,5 +80,39 @@ Public Class EmailService
Return True
End Function
Public Function SendDocumentCompletedEmailToReceiver(pEnvelope As Envelope, pReceiver As EnvelopeReceiver, pAttachment As String) As Boolean
Dim oEmailData = New EmailData(pEnvelope, pReceiver, Constants.EnvelopeStatus.MessageCompletionSent) With
{
.SignatureLink = "",
.EmailAttachment = pAttachment
}
EmailTemplate.FillDocumentCompletedEmailBody(oEmailData)
If EmailModel.Insert(oEmailData) = False Then
Logger.Error("EMail data could not be inserted.")
Return False
End If
Return True
End Function
Public Function SendDocumentCompletedEmailToCreator(pEnvelope As Envelope, pAttachment As String) As Boolean
Dim oEmailData = New EmailData(pEnvelope, Constants.EnvelopeStatus.MessageCompletionSent) With
{
.SignatureLink = "",
.EmailAttachment = pAttachment
}
EmailTemplate.FillDocumentCompletedEmailBody(oEmailData)
If EmailModel.Insert(oEmailData) = False Then
Logger.Error("EMail data could not be inserted.")
Return False
End If
Return True
End Function
End Class