10.01.2024
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
|
||||
Public Class EmailData
|
||||
Public Property EmailAdress As String
|
||||
Public Property EmailSubject As String
|
||||
Public Property EmailBody As String
|
||||
Public Property EmailType As Constants.EnvelopeStatus
|
||||
Public Property ReferenceID As Integer
|
||||
Public Property ReferenceString As String
|
||||
Public Property EmailAdress As String = ""
|
||||
Public Property EmailSubject As String = ""
|
||||
Public Property EmailBody As String = ""
|
||||
Public Property EmailType As Constants.EnvelopeStatus = Constants.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 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 SignatureLink As String = ""
|
||||
Public Property Message As String = ""
|
||||
Public Property EnvelopeTitle As String = ""
|
||||
|
||||
Public Property EmailAttachment As String = ""
|
||||
|
||||
|
||||
@@ -144,7 +144,9 @@ Namespace Jobs
|
||||
Throw New ExportDocumentException("Could not export final document to disk!", ex)
|
||||
End Try
|
||||
|
||||
SendFinalEmails(oEnvelope, oOutputFilePath)
|
||||
If SendFinalEmails(oEnvelope, oOutputFilePath) = False Then
|
||||
Throw New ApplicationException("Final emails could not be sent!")
|
||||
End If
|
||||
|
||||
oCurrent += 1
|
||||
Logger.Info("Envelope finalized!")
|
||||
@@ -156,6 +158,10 @@ Namespace Jobs
|
||||
Logger.Warn("Certificate Document job failed at step: Merging documents!")
|
||||
Logger.Error(ex)
|
||||
|
||||
Catch ex As ExportDocumentException
|
||||
Logger.Warn("Certificate Document job failed at step: Exporting document!")
|
||||
Logger.Error(ex)
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Warn("Certificate Document job failed!")
|
||||
Logger.Error(ex)
|
||||
@@ -171,10 +177,12 @@ Namespace Jobs
|
||||
Dim oMailToReceivers = pEnvelope.FinalEmailToReceivers
|
||||
|
||||
If oMailToCreator <> FinalEmailType.No Then
|
||||
Logger.Debug("Sending email to creator..")
|
||||
SendFinalEmailToCreator(pEnvelope, pAttachment)
|
||||
End If
|
||||
|
||||
If oMailToReceivers <> FinalEmailType.No Then
|
||||
Logger.Debug("Sending emails to receivers..")
|
||||
SendFinalEmailToReceivers(pEnvelope, pAttachment)
|
||||
End If
|
||||
|
||||
@@ -185,6 +193,7 @@ Namespace Jobs
|
||||
Dim oIncludeAttachment = SendFinalEmailWithAttachment(pEnvelope.FinalEmailToCreator)
|
||||
Dim oAttachment = Nothing
|
||||
|
||||
Logger.Debug("Attachment included: [{0}]", oIncludeAttachment)
|
||||
If oIncludeAttachment Then
|
||||
oAttachment = pAttachment
|
||||
End If
|
||||
@@ -201,6 +210,7 @@ Namespace Jobs
|
||||
Dim oIncludeAttachment = SendFinalEmailWithAttachment(pEnvelope.FinalEmailToReceivers)
|
||||
Dim oAttachment = Nothing
|
||||
|
||||
Logger.Debug("Attachment included: [{0}]", oIncludeAttachment)
|
||||
If oIncludeAttachment Then
|
||||
oAttachment = pAttachment
|
||||
End If
|
||||
|
||||
@@ -179,6 +179,21 @@ Public Class ReceiverModel
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ListReceivers() As IEnumerable(Of EnvelopeReceiver)
|
||||
Try
|
||||
Dim oSql = $"SELECT * FROM [dbo].[TBSIG_RECEIVER]"
|
||||
Dim oTable = Database.GetDatatable(oSql)
|
||||
|
||||
Return oTable?.Rows.Cast(Of DataRow).
|
||||
Select(AddressOf ToReceiver).
|
||||
ToList()
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Function ListReceivers(pReceiversFromGrid As List(Of EnvelopeReceiver)) As IEnumerable(Of EnvelopeReceiver)
|
||||
Try
|
||||
If pReceiversFromGrid.Count = 0 Then
|
||||
|
||||
@@ -87,6 +87,8 @@ Public Class EmailService
|
||||
.EmailAttachment = pAttachment
|
||||
}
|
||||
|
||||
Logger.Debug("Sending mail to receiver: [{0}]", oEmailData.EmailAdress)
|
||||
|
||||
EmailTemplate.FillDocumentCompletedEmailBody(oEmailData)
|
||||
|
||||
If EmailModel.Insert(oEmailData) = False Then
|
||||
|
||||
Reference in New Issue
Block a user