Skip to content
Snippets Groups Projects
Commit 7a4fefaf authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon:
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1061035][Serienmail - Testen - Fehler im Serverlog]

parent 09c2ef76
No related branches found
No related tags found
No related merge requests found
......@@ -18,5 +18,5 @@
<include relativeToChangelogFile="true" file="basic/2020.2.0/changelog.xml"/>
<!--enable this only when you definetly want to overwrite the existing data with demo records:-->
<!--<include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/>-->
<include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -380,8 +380,25 @@ Email.prototype.send = function (pUser)
if (this.sender)
mail.setSender(mailId, this.sender);
var sentMails = mail.sendMailAs(pUser || "mailbridge", mailId)
var mailbridgeTitle = "mailbridge";
var sentMails;
if(pUser)
sentMails = mail.sendMailAs(pUser, mailId)
else
{
let mailbridgeExists = newSelect("ADITO.ASYS_USERS.PROPVAL")
.from("ADITO.ASYS_USERS")
.where("ADITO.ASYS_USERS.PROPVAL", "title")
.and("ADITO.ASYS_USERS.PROPVAL", mailbridgeTitle)
.cell();
if(mailbridgeExists)
mail.sendMailAs(mailbridgeTitle, mailId)
else
throw new Error(translate.withArguments("Mailbridge failed, user %0 is unknown, contact an administrator.", [mailbridgeTitle]));
}
// remove from cache
mail.deleteMail(mailId)
return sentMails > 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment