diff --git a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod index 316202beaa5e6c405f9156e33ff19f7839b632a0..373d655f28ec9048982adfd44d59c465f5ecf024 100644 --- a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod +++ b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod @@ -197,6 +197,10 @@ <description>Save Location for send Mails. Path is relative to Serverpath</description> <property>/bulkMailFiles/</property> </customStringProperty> + <customStringProperty> + <name>bulkmail.user</name> + <description>Title of the useraccount that is used to send bulkmails</description> + </customStringProperty> <customStringProperty> <name>mosaico.url</name> <description>Url of the Mosaico Email Editor</description> diff --git a/process/Bulkmail_lib/process.js b/process/Bulkmail_lib/process.js index aa2afd3aa5e7a74b74183e0a18a0ce7ffeee87cb..8ee731de4c844543191eebeba3a0d6522b89d028 100644 --- a/process/Bulkmail_lib/process.js +++ b/process/Bulkmail_lib/process.js @@ -78,6 +78,8 @@ BulkMailUtils.sendBulkMail = function (pBulkMailId, pIsTestRun) pIsTestRun = false; } + var sendUserTitle = project.getPreferenceValue("custom.bulkmail.user"); + var [templateId, subject, emailSender, createActivity, bulkMailName, useTemplateAttachments] = newSelect("DOCUMENTTEMPLATE_ID, SUBJECT, SENDER_EMAIL_ADDRESS, CREATEACTIVITIES, NAME, USE_TEMPLATE_ATTACHMENTS") .from("BULKMAIL") @@ -190,7 +192,7 @@ BulkMailUtils.sendBulkMail = function (pBulkMailId, pIsTestRun) email.subject = subjects[contactId]; BulkMailUtils.storeEmlFile(pBulkMailId, mailrunId, mailLogId,email.getEML()); - isSuccess = email.send(); + isSuccess = email.send(sendUserTitle); if (!isSuccess) { var errorMessage = logging.toLogString(email.getMailError(), true); @@ -202,6 +204,7 @@ BulkMailUtils.sendBulkMail = function (pBulkMailId, pIsTestRun) recipientStatus = bouncedStatus || $KeywordRegistry.bulkMailRecipientStatus$failed(); } +email.send(sendUserTitle); } //set the recipient status to 'sent' or 'failed' @@ -305,7 +308,7 @@ BulkMailUtils.sendBulkMail = function (pBulkMailId, pIsTestRun) let nextMailLogId = util.getNewUUID(); email.body = StringUtils.replaceAll(email.body,currentMailLogId,nextMailLogId); currentMailLogId = nextMailLogId; - isSuccess = email.send(); + isSuccess = email.send(sendUserTitle); Array.prototype.push.call(isSuccess ? successIds : failedIds, recipientData[i]["BULKMAILRECIPIENTID"]);