Jobs: Change Email Text for Filesize Exceeded
This commit is contained in:
parent
662c3f3ed4
commit
b323445821
@ -23,7 +23,13 @@
|
|||||||
|
|
||||||
Public Const EMAIL_NO_FERDS = "<p>Ihre Email enthielt keine ZUGFeRD-Dokumente.</p>"
|
Public Const EMAIL_NO_FERDS = "<p>Ihre Email enthielt keine ZUGFeRD-Dokumente.</p>"
|
||||||
|
|
||||||
Public Const EMAIL_FILE_SIZE_REACHED = "<p>Ihre Email enthielt Dateien, die die erlaubte Größe von {0}MB überschreiten.</p>"
|
Public Const EMAIL_FILE_SIZE_REACHED = """
|
||||||
|
<p>Die von Ihnen gesendete Rechnung oder einer der Rechnungs-Anhänge überschreiten die erlaubte Größe von <strong>{0} MB</strong>.</p>
|
||||||
|
<p>Die folgende Datei hat die erlaubte Größe überschritten:<ul>
|
||||||
|
<li>{1}</li>
|
||||||
|
</ul></p>
|
||||||
|
<p>Der Betreff der Original-Email war: {2}</p>
|
||||||
|
"""
|
||||||
|
|
||||||
Public Const EMAIL_INVALID_DOCUMENT = """
|
Public Const EMAIL_INVALID_DOCUMENT = """
|
||||||
<p>Ihre Email enthielt ein ZUGFeRD Dokument, welches aber inkorrekt formatiert wurde.</p>
|
<p>Ihre Email enthielt ein ZUGFeRD Dokument, welches aber inkorrekt formatiert wurde.</p>
|
||||||
|
|||||||
@ -407,8 +407,10 @@ Public Class ImportZUGFeRDFiles
|
|||||||
|
|
||||||
Create_HistoryEntry(oMessageId, oMD5CheckSum, "REJECTED - File size limit reached", oFBTransaction)
|
Create_HistoryEntry(oMessageId, oMD5CheckSum, "REJECTED - File size limit reached", oFBTransaction)
|
||||||
|
|
||||||
Dim oBody = String.Format(EmailStrings.EMAIL_FILE_SIZE_REACHED, oArgs.MaxAttachmentSizeInMegaBytes)
|
|
||||||
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
|
Dim oEmailData = MoveAndRenameEmailToRejected(oArgs, oMessageId)
|
||||||
|
Dim oKey = FileSizeLimitReachedException.KEY_FILENAME
|
||||||
|
Dim oFileExceedingThreshold = IIf(ex.Data.Contains(oKey), ex.Data.Item(oKey), "")
|
||||||
|
Dim oBody = String.Format(EmailStrings.EMAIL_FILE_SIZE_REACHED, oArgs.MaxAttachmentSizeInMegaBytes, oFileExceedingThreshold, oEmailData.Subject)
|
||||||
|
|
||||||
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "FileSizeLimitReachedException", _EmailOutAccountId)
|
_email.AddToEmailQueueMSSQL(oMessageId, oBody, oEmailData, "FileSizeLimitReachedException", _EmailOutAccountId)
|
||||||
AddRejectedState(oMessageId, "FileSizeLimitReachedException", "Erlaubte Dateigröße überschritten", "", oSQLTransaction)
|
AddRejectedState(oMessageId, "FileSizeLimitReachedException", "Erlaubte Dateigröße überschritten", "", oSQLTransaction)
|
||||||
@ -767,6 +769,7 @@ Public Class ImportZUGFeRDFiles
|
|||||||
''' <returns></returns>
|
''' <returns></returns>
|
||||||
Private Function Check_FileSize(pFileInfo As FileInfo, pMaxFileSizeInMegaBytes As Integer) As Boolean
|
Private Function Check_FileSize(pFileInfo As FileInfo, pMaxFileSizeInMegaBytes As Integer) As Boolean
|
||||||
_logger.Info("Checking Filesize of {0}", pFileInfo.Name)
|
_logger.Info("Checking Filesize of {0}", pFileInfo.Name)
|
||||||
|
_logger.Debug("Filesize threshold is {0} MB.", pMaxFileSizeInMegaBytes)
|
||||||
|
|
||||||
If pMaxFileSizeInMegaBytes <= 0 Then
|
If pMaxFileSizeInMegaBytes <= 0 Then
|
||||||
_logger.Debug("Filesize is not configured. Skipping check.")
|
_logger.Debug("Filesize is not configured. Skipping check.")
|
||||||
@ -775,8 +778,6 @@ Public Class ImportZUGFeRDFiles
|
|||||||
|
|
||||||
Dim oMaxSize = pMaxFileSizeInMegaBytes * 1024 * 1024
|
Dim oMaxSize = pMaxFileSizeInMegaBytes * 1024 * 1024
|
||||||
|
|
||||||
_logger.Debug("Filesize threshold is {0} bytes.", oMaxSize)
|
|
||||||
|
|
||||||
If oMaxSize > 0 And pFileInfo.Length > oMaxSize Then
|
If oMaxSize > 0 And pFileInfo.Length > oMaxSize Then
|
||||||
_logger.Debug("Filesize is bigger than threshold. Rejecting.")
|
_logger.Debug("Filesize is bigger than threshold. Rejecting.")
|
||||||
Return False
|
Return False
|
||||||
|
|||||||
@ -24,8 +24,11 @@ Public Class Exceptions
|
|||||||
Public Class FileSizeLimitReachedException
|
Public Class FileSizeLimitReachedException
|
||||||
Inherits ApplicationException
|
Inherits ApplicationException
|
||||||
|
|
||||||
|
Public Const KEY_FILENAME = "FILENAME"
|
||||||
|
|
||||||
Public Sub New(pFilePath As String, pFileSizeLimitInMegaBytes As Integer)
|
Public Sub New(pFilePath As String, pFileSizeLimitInMegaBytes As Integer)
|
||||||
MyBase.New($"At least one file exceeded the filesize limit of {pFileSizeLimitInMegaBytes}MB: {pFilePath}")
|
MyBase.New($"At least one file exceeded the filesize limit of {pFileSizeLimitInMegaBytes}MB: {pFilePath}")
|
||||||
|
Data.Add(KEY_FILENAME, pFilePath)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user