Reverted change in post email serializer

refs d4540012dc

This was committed by accident
This commit is contained in:
Simon Backx 2022-10-06 20:16:02 +02:00
parent 220af3b276
commit 9d27014aff

View File

@ -358,17 +358,13 @@ const PostEmailSerializer = {
// Now replace the links in the HTML version
if (!options.isBrowserPreview && !options.isTestEmail && settingsCache.get('email_track_clicks')) {
result.html = await linkReplacer.replace(result.html, async (url) => {
// Add newsletter source attribution
url = memberAttribution.service.addEmailSourceAttributionTracking(url, newsletter);
const isSite = urlUtils.isSiteUrl(url);
if (isSite) {
url = memberAttribution.service.addEmailSourceAttributionTracking(url, newsletter);
// Only add post attribution to our own site (because external sites could/should not process this information)
url = memberAttribution.service.addPostAttributionTracking(url, post);
} else {
// For external sites, add ref to the site URL instead of newsletter
const siteUrl = new URL(urlUtils.urlFor('home', true));
url.searchParams.append('ref', siteUrl.hostname);
}
// Add link click tracking