VERP test send BUG fixed

This commit is contained in:
root 2019-07-25 11:51:17 +02:00
parent 75138f9728
commit 1e94a0419e

View file

@ -85,8 +85,6 @@ class CampaignSender {
return sendConfiguration[key]; return sendConfiguration[key];
}; };
const campaignAddress = [campaign.cid, list.cid, subscriptionGrouped.cid].join('.');
const mail = { const mail = {
from: { from: {
name: getOverridable('from_name'), name: getOverridable('from_name'),
@ -98,29 +96,11 @@ class CampaignSender {
name: list.to_name === null ? undefined : tools.formatMessage(campaign, list, subscriptionGrouped, mergeTags, list.to_name, false), name: list.to_name === null ? undefined : tools.formatMessage(campaign, list, subscriptionGrouped, mergeTags, list.to_name, false),
address: subscriptionGrouped.email address: subscriptionGrouped.email
}, },
sender: useVerpSenderHeader ? campaignAddress + '@' + sendConfiguration.verp_hostname : false, sender: false,
envelope: useVerp ? { envelope: false,
from: campaignAddress + '@' + sendConfiguration.verp_hostname,
to: subscriptionGrouped.email
} : false,
headers: { headers: {
'x-fbl': campaignAddress,
// custom header for SparkPost
'x-msys-api': JSON.stringify({
campaign_id: campaignAddress
}),
// custom header for SendGrid
'x-smtpapi': JSON.stringify({
unique_args: {
campaign_id: campaignAddress
}
}),
// custom header for Mailgun
'x-mailgun-variables': JSON.stringify({
campaign_id: campaignAddress
}),
'List-ID': { 'List-ID': {
prepared: true, prepared: true,
value: libmime.encodeWords(list.name) + ' <' + list.cid + '.' + getPublicUrl() + '>' value: libmime.encodeWords(list.name) + ' <' + list.cid + '.' + getPublicUrl() + '>'
@ -135,10 +115,12 @@ class CampaignSender {
attachments, attachments,
encryptionKeys encryptionKeys
}; };
let response; let response;
try { try {
const info = await mailer.sendMassMail(mail); const info = await mailer.sendMassMail(mail);
response = info.response || info.messageId; response = info.response || info.messageId;