Compare commits

...

3 Commits

Author SHA1 Message Date
0db24f53e9 Common: E-Mail Strings 2024-02-02 12:28:41 +01:00
bb11ff18e5 Common: Version 2.13 2024-02-02 11:07:29 +01:00
84b3177e29 Common: oHistoryID is not always numeric, but we need the Rejection Mail 2024-02-02 11:06:22 +01:00
3 changed files with 17 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
Public Class EmailStrings
Public Const EMAIL_WRAPPING_TEXT = "<html><body style=''font-family:""Arial"";font-size:10.0pt''>Sehr geehrte Damen und Herren,<br/><br/>
das Portal konnte die von Ihnen gesandte Email leider nicht verarbeiten! <br><br> Grund: {0}<p>Bitte prüfen Sie die Email und nehmen Sie bei Bedarf mit uns Kontakt auf.<p>
Vielen Dank für Ihr Verständnis.<br>Mit freundlichen Grüßen<br>Ihre IT-Abteilung</body></html>"
Vielen Dank für Ihr Verständnis.<br>Mit freundlichen Grüßen<br>Ihre WISAG</body></html>"
Public Const EMAIL_SUBJECT_TEXT = "<p>Der Betreff der Original-Email war: <em>{0}</em></p>"
Public Const EMAIL_SUBJECT_REJECTED = "Beleg abgelehnt"

View File

@@ -12,8 +12,8 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("")>
<Assembly: AssemblyCompany("")>
<Assembly: AssemblyProduct("DigitalData.EMLProfiler")>
<Assembly: AssemblyCopyright("Copyright © 2023")>
<Assembly: AssemblyTrademark("2.12.0.0")>
<Assembly: AssemblyCopyright("Copyright © 2024")>
<Assembly: AssemblyTrademark("2.13.0.0")>
<Assembly: ComVisible(False)>
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.12.0.0")>
<Assembly: AssemblyFileVersion("2.12.0.0")>
<Assembly: AssemblyVersion("2.13.0.0")>
<Assembly: AssemblyFileVersion("2.13.0.0")>

View File

@@ -119,7 +119,7 @@ Public Class clsWorkEmail
Dim oHistoryID = _DB_MSSQL.GetScalarValue(oSql)
If oHistoryID > 0 Then
_Logger.Info($"Messsage with subject [{CURRENT_MAIL_SUBJECT}] from [{CURRENT_MAIL_FROM}] has already been worked!")
_Logger.Info($"Message with subject [{CURRENT_MAIL_SUBJECT}] from [{CURRENT_MAIL_FROM}] has already been worked!")
Return True
End If
@@ -142,7 +142,7 @@ Public Class clsWorkEmail
End Try
If oTempMailAccessible = False Then
_Logger.Warn("Could not process email [{0}], file does is not accessible!", CurrentMail.MessageId)
_Logger.Warn("Could not process email [{0}], file is not accessible!", CurrentMail.MessageId)
Return False
End If
@@ -162,7 +162,7 @@ Public Class clsWorkEmail
'insert history und exit
InsertHistoryEntryWithStatus(CurrentMail, "REJECTED", oResult)
AddToEmailQueueMSSQL(CurrentMail.MessageId, oResult, "Email validation failed", _EmailAccountID)
AddEmailToQueueMSSQL(CurrentMail.MessageId, oResult, "Email validation failed", _EmailAccountID)
' Return early from processing eml
Return True
@@ -186,7 +186,7 @@ Public Class clsWorkEmail
If CURRENT_ATTMT_COUNT = 0 Then
_Logger.Info("### Mail contained no Attachments!! ###")
Dim oBody = EmailStrings.EMAIL_NO_FERDS
If AddToEmailQueueMSSQL(CurrentMail.MessageId, oBody, "No Attachments", _EmailAccountID) = True Then
If AddEmailToQueueMSSQL(CurrentMail.MessageId, oBody, "No Attachments", _EmailAccountID) = True Then
CURRENT_ImapObject.DeleteMessageByUID(poUID)
End If
InsertHistoryEntryWithStatus(CurrentMail, "REJECTED", "No Attachments")
@@ -204,7 +204,7 @@ Public Class clsWorkEmail
End Try
End Function
Public Function AddToEmailQueueMSSQL(MessageId As String, BodyText As String, Comment As String, pEmailAccountId As Integer) As Boolean
Public Function AddEmailToQueueMSSQL(MessageId As String, BodyText As String, Comment As String, pEmailAccountId As Integer) As Boolean
Try
Dim oReference = MessageId
@@ -232,11 +232,10 @@ Public Class clsWorkEmail
_Logger.Debug("To: {0}", oEmailTo)
_Logger.Debug("Subject: {0}", oSubject)
_Logger.Debug("Body {0}", oFinalBodyText)
Dim osql = $"Select MAX(GUID) FROM TBEMLP_HISTORY WHERE EMAIL_MSGID = '{MessageId}'"
Dim oHistoryID = _DB_MSSQL.GetScalarValue(osql)
Dim osql = $"Select COALESCE(MAX(GUID), 0) FROM TBEMLP_HISTORY WHERE EMAIL_MSGID = '{MessageId}'"
Dim oHistoryID As Integer = _DB_MSSQL.GetScalarValue(osql)
If IsNumeric(oHistoryID) Then
Dim oInsert = $"INSERT INTO [dbo].[TBEMLP_EMAIL_OUT] (
Dim oInsert = $"INSERT INTO [dbo].[TBEMLP_EMAIL_OUT] (
[REMINDER_TYPE_ID]
,[SENDING_PROFILE]
,[REFERENCE_ID]
@@ -259,13 +258,13 @@ Public Class clsWorkEmail
,'{Comment}'
,'{oCreatedWho}')"
Return _DB_MSSQL.ExecuteNonQuery(oInsert)
Else
_Logger.Warn($"!! Could not get oHistoryID in AddToEmailQueueMSSQL [{osql}]")
End If
Catch ex As Exception
_Logger.Error(ex)
Return False
End Try
Return True
End Function
Private Function PROCESS_MANAGER_IN(pCurrentMail As MailContainer) As Boolean
Try
@@ -448,7 +447,7 @@ Public Class clsWorkEmail
End Function
Private Function SAVE2TEMP(pCurrentMail As MailContainer) As Boolean
Dim oTempFilename As String
Dim oTempFilename As String = ""
Try
Dim oTempPath As String = Path.Combine(Path.GetTempPath, "DD_EmailProfiler")