Jobs/zugferd: add fallback for missing values in GetEmailDataForMessageId
This commit is contained in:
parent
79cad24b3f
commit
902c835c37
@ -1,5 +1,6 @@
|
|||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
Imports DigitalData.Modules.Database
|
Imports DigitalData.Modules.Database
|
||||||
|
Imports DigitalData.Modules.Language
|
||||||
Imports System.Data
|
Imports System.Data
|
||||||
Imports System.IO
|
Imports System.IO
|
||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
@ -164,10 +165,19 @@ Public Class EmailFunctions
|
|||||||
_logger.Debug("Got Email Data for FileId {0}", MessageId)
|
_logger.Debug("Got Email Data for FileId {0}", MessageId)
|
||||||
oRow = oDatatable.Rows.Item(oDatatable.Rows.Count - 1)
|
oRow = oDatatable.Rows.Item(oDatatable.Rows.Count - 1)
|
||||||
|
|
||||||
|
Dim oFromDefault = String.Format("No Sender found for ({0})", MessageId)
|
||||||
|
Dim oFrom = oRow.ItemEx("EMAIL_FROM", oFromDefault)
|
||||||
|
|
||||||
|
Dim oAttachmentDefault = String.Format("No Attachment found for ({0})", MessageId)
|
||||||
|
Dim oAttachment = oRow.ItemEx("EMAIL_ATTMT1", oAttachmentDefault)
|
||||||
|
|
||||||
|
Dim oSubjectDefault = String.Format("No Subject found for ({0})", MessageId)
|
||||||
|
Dim oSubject = oRow.ItemEx("EMAIL_SUBJECT", oSubjectDefault)
|
||||||
|
|
||||||
Return New EmailData() With {
|
Return New EmailData() With {
|
||||||
.From = oRow.Item("EMAIL_FROM"),
|
.From = oFrom,
|
||||||
.Attachment = oRow.Item("EMAIL_ATTMT1"),
|
.Attachment = oAttachment,
|
||||||
.Subject = oRow.Item("EMAIL_SUBJECT")
|
.Subject = oSubject
|
||||||
}
|
}
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_logger.Warn("Could not fetch Email Data for FileId {0}", MessageId)
|
_logger.Warn("Could not fetch Email Data for FileId {0}", MessageId)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user