Updated newsletter attribution to use the name rather than slug

The slug from the fixtures is "default-newsletter" which doesn't correctly
reflect the name of most sites newsletters. Because we're using the URL
constructor it handles all of the URL encoding/decoding on both ends for us.
This commit is contained in:
Fabien "egg" O'Carroll 2022-09-29 11:50:47 +01:00
parent 99e6f8ddda
commit a05ef5ef95

View File

@ -34,7 +34,8 @@ class MemberAttributionService {
addEmailSourceAttributionTracking(url, newsletter) {
// Create a deep copy
url = new URL(url);
url.searchParams.append('ref', newsletter.get('slug') + '-newsletter');
// We slugify the name here so that we don't use the default slugs in fixtures
url.searchParams.append('ref', newsletter.get('name') + '-newsletter');
return url;
}