updated with support for link wrapping in URL camp

This commit is contained in:
Eric Uldall 2019-10-25 05:20:41 -07:00
parent 3a2d1512ab
commit 3124df6989
2 changed files with 6 additions and 4 deletions

View file

@ -214,7 +214,7 @@ class MessageSender {
html = response.body;
text = '';
renderTags = false;
renderTags = true;
}
const attachments = this.attachments.slice();
@ -236,8 +236,10 @@ class MessageSender {
html = await links.updateLinks(html, this.tagLanguage, mergeTags, campaign, list, subscriptionGrouped);
}
// When no list and subscriptionGrouped is provided, formatCampaignTemplate works the same way as formatTemplate
html = tools.formatCampaignTemplate(html, this.tagLanguage, mergeTags, true, campaign, list, subscriptionGrouped);
if (campaign.source !== CampaignSource.URL) {
// When no list and subscriptionGrouped is provided, formatCampaignTemplate works the same way as formatTemplate
html = tools.formatCampaignTemplate(html, this.tagLanguage, mergeTags, true, campaign, list, subscriptionGrouped);
}
}
const generateText = !!(text || '').trim();

View file

@ -140,7 +140,7 @@ async function addOrGet(campaignId, url) {
}
}
async function updateLinks(source, tagLanguage, mergeTags, campaign, list, subscription) {
async function updateLinks(source, tagLanguage='simple', mergeTags, campaign, list, subscription) {
if ((campaign.open_tracking_disabled && campaign.click_tracking_disabled) || !source || !source.trim()) {
// tracking is disabled, do not modify the message
return source;