Merge of PR #654 and some updates to it.

This commit is contained in:
Tomas Bures 2019-08-07 11:25:47 +02:00
parent c1a9404648
commit 2202f228eb

View file

@ -293,6 +293,8 @@ class MessageSender {
let subscriptionGrouped, list; // May be undefined let subscriptionGrouped, list; // May be undefined
const campaign = this.campaign; // May be undefined const campaign = this.campaign; // May be undefined
const sendConfiguration = this.sendConfiguration;
let mergeTags = subData.mergeTags; let mergeTags = subData.mergeTags;
if (subData.listId) { if (subData.listId) {
@ -347,15 +349,16 @@ class MessageSender {
if (campaign) { if (campaign) {
const campaignAddress = [campaign.cid, list.cid, subscriptionGrouped.cid].join('.'); const campaignAddress = [campaign.cid, list.cid, subscriptionGrouped.cid].join('.');
if (this.useVerp) { if (this.useVerp) {
envelope = { envelope = {
from: campaignAddress + '@' + this.sendConfiguration.verp_hostname, from: campaignAddress + '@' + sendConfiguration.verp_hostname,
to: subscriptionGrouped.email to: subscriptionGrouped.email
}; };
} }
if (this.useVerpSenderHeader) { if (this.useVerpSenderHeader) {
sender = campaignAddress + '@' + this.sendConfiguration.verp_hostname; sender = campaignAddress + '@' + sendConfiguration.verp_hostname;
} }
headers['x-fbl'] = campaignAddress; headers['x-fbl'] = campaignAddress;
@ -388,7 +391,6 @@ class MessageSender {
return; return;
} }
const sendConfiguration = this.sendConfiguration;
const mailer = await mailers.getOrCreateMailer(sendConfiguration.id); const mailer = await mailers.getOrCreateMailer(sendConfiguration.id);
await mailer.throttleWait(); await mailer.throttleWait();