10.01.2024

This commit is contained in:
Jonathan Jenne
2024-01-10 13:06:55 +01:00
parent 37908b6a1b
commit c7dba51ec9
8 changed files with 58 additions and 20 deletions

View File

@@ -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