Page MenuHomePhabricator

French TY email sending donors to unsubscribe page in English
Closed, ResolvedPublic


Various French donors have reached out to us that the unsubscribe page in the French Thank You email they received is in English. We have tested and are able to reproduce this, and it seems there is a possible error with the URL having an extra '-fr' at the end (we noticed that removing it sends donors to their unique French-language unsubscribe page).

Ticket examples:

All have unique unsubscribe URLs ending : uselang=fr-fr and if you edit it to uselang=fr it redirects to the French language version.

(full URL not included for donor PII reasons, as each URL is unique to the donor's email address, which is visible once you click on the link).

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptAug 19 2020, 4:20 PM
DStrine triaged this task as Medium priority.Sep 1 2020, 9:53 PM

@krobinson do you have any cids to reference? It looks like language gets passed as a param to the unsubscribe link so I'd like to see if there's anything special about these donors leading to fr-fr getting passed.

CID 45300049 - 7771219
CID 45288129 - 16288081
CID 45321577 - 22506831
CID 45316912
@mepps CID's from the tickets mentioned by Kristie.

Thanks @SHust

Here's some more from TY emails sent today:
CID 45726420; 7873343; 27105373; 45673086

Let me know if you need more examples @mepps

So I'm not seeing much in those contacts. They're language is set to French (France) which appears correct. In the code, the unsubscribe link is built from $mailingData['preferred_language'] and then using wmf_common_locale_civi_to_mediawiki($locale) to convert it. That function just converts it to lower and replaces underscores with strtolower( str_replace( '_', '-', $locale ) );.

@mepps did you notice the first comment about the extra -fr in the URL? We noticed that removing it sends people to the correct language version of the page. Not sure if that helps. If you can access their tickets in Zendesk you can see their actual unique URLs.

@krobinson I did, thank you! I'm just trying to figure out where the extra fr- is getting generated.

So based on the code, this should mean somewhere locale is getting passed to the thank you module as "fr-fr" but I need to figure out where.

Okay so I'm wondering why we're just hearing about this from donors. It appears to me that this is larger than just french. Basically, to get the language it looks in the db for preferred languages which is in the format XX_ll where XX is country code and ll is language. We convert this to the "wiki way" which just makes it xx-ll. But the unsubscribe page only accepts the second half as a param based on my testing so spanish wouldn't work either. The fix is likely to change how the parameter is passed to build the link but I want to make sure nothing has changed recently that impacted how this works.

You're right @mepps! I just checked out a couple of recent responses to TY emails in Spanish and the unsub page is indeed in English, despite the TY email being in Spanish.

The url is =es-es, and if I strip the second -es it reverts to Spanish.

CID 45644215 / #792205 is an example.

Thanks for checking on that @krobinson! So now we just want to confirm the fix is to change how the url is generated and not to change how mediawiki interprets uselang for unsubscribe.

@Ejegg my read of the unsubscribe code is that core mediawiki uses fr instead of fr-fr for language codes so we probably want to change what gets sent from civi.

Change 626204 had a related patch set uploaded (by Mepps; owner: Mepps):
[wikimedia/fundraising/crm@master] Use last two characters of locale for mediawiki compatibility

When I test French I'm getting uselang=fr-gb in the URL. So I think we want to use the first two characters, rather than the last two?

Ahh yeah my brain spaced. I updated the patch, thanks @Pcoombe!

Hm so what's happening is that l10_currency needs the country which I took out to make unsubscribe link work..

My next step will be to try only converting the $locale for the unsubscribe link because otherwise I don't think it needs reformatting.

We've been exploring this in tech talk and unfortunately there's a lot of trickiness. Basically, the current fix will allow more donors to see translations but it will actually block some from seeing further localization, like in the case of Brazilian Portuguese. I updated my patch to get the currency translation working again but we may want to look again at whether there's anything that we can do on the mediawiki end.

Based on talking to @MBeat33 and my own testing, this is ready to go. It's such a small amount of text that there's no difference between language variants--at least with pt and pt-br which I tested.

mepps removed mepps as the assignee of this task.Sep 28 2020, 1:19 PM

Change 626204 merged by jenkins-bot:
[wikimedia/fundraising/crm@master] Use first two characters of locale for mediawiki compatibility