From 85157793571bf92117501ecf44c8a354d4367f9c Mon Sep 17 00:00:00 2001
From: "b.ulrich" <b.ulrich@adito.de>
Date: Wed, 7 Oct 2020 13:49:04 +0200
Subject: [PATCH] [Projekt: Entwicklung - Neon][TicketNr.: 1061035][Serienmail
 - Testen - Fehler im Serverlog]

---
 process/Email_lib/process.js | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/process/Email_lib/process.js b/process/Email_lib/process.js
index 4d83ba5711..bffbe633e2 100644
--- a/process/Email_lib/process.js
+++ b/process/Email_lib/process.js
@@ -11,7 +11,8 @@ import("Communication_lib");
 import("DocumentTemplate_lib");
 import("system.neon");
 import("system.mail");
-import("Bulkmail_lib")
+import("Bulkmail_lib");
+import("system.tools");
 
 function EmailWritingUtils () {}
 
@@ -382,18 +383,13 @@ Email.prototype.send = function (pUser)
         if (this.sender)
             mail.setSender(mailId, this.sender);
         var mailbridgeTitle = "mailbridge";
-        
-        
         var sentMails;
         if(pUser)
             sentMails = mail.sendMailAs(pUser, mailId)
         else
         {
-            let mailbridgeExists = newSelect("ASYS_USERS.PROPVAL", SqlUtils.getSystemAlias())
-                                            .from("ASYS_USERS")
-                                            .where("ASYS_USERS.PROPVAL", "title")
-                                            .and("ASYS_USERS.PROPVAL", mailbridgeTitle)
-                                            .cell();
+            let mailbridgeExists = tools.getUser(mailbridgeTitle);
+            
             if(mailbridgeExists)
                 mail.sendMailAs(mailbridgeTitle, mailId)
             else //check mailbridge user if this error gets thrown
-- 
GitLab