Page MenuHomePhabricator

Identify and revert wrongly updated country/currency in Civi
Closed, ResolvedPublic

Description

On August 14, 2025, an Email 0 was sent out to 6C with template name 1_20250814_6Countries(6C)_English(en)_Email0_T1-Control_6C-MicrosoftWarmup.

This send incorrectly had a donation ask with a hardcoded country=US parameter. As a result, there may be non-US donors who've completed gifts in USD. This updated their Civi records to US & USD, which will impact future Acoustic emails (incorrect renders of Dynamic Content).

The request here is, if possible, to identify these donors and revert their country/currency to their previous values, prior to their donation of this particular ask.

UTM Parameter Details:

  • wmf_campaign=C2526_Email0
  • wmf_medium=email
  • wmf_source=sp75127591

Event Timeline

Thanks @ppenloglou

Example: CID 34214637 (country has already been manually corrected back to Canada by DR)

Once we have these records updated, a spin off request may be to look into what safeguards we have in place to prevent a miscoded fundraising email from changing core donor information like country. This feels like a vulnerability in our current set up that could have big audience / segmentation impacts.

Scoping this out:
Roughly 1k donors affected, including ~60 with new recurring donations.
Only about half have a changed country.

We can set Last Currency and Country plus State/Province back to their original values for these donors, but I believe the new recurring donations will present a problem as their Last Currency will be updated by the DB trigger for every recurring donation. We may have to handle those ones differently.

Even for the one-time donors the trigger will change it back to the last one on the donations table the next time the contact is touched.

@Ejegg, That's worse than I thought. Have we dealt with this before and worked out a way to correct these?

Lars triaged this task as Medium priority.Sep 3 2025, 4:39 PM

@Cstone Here are a couple SKs:
https://civicrm.wikimedia.org/civicrm/admin/search#/edit/6293
https://civicrm.wikimedia.org/civicrm/admin/search#/edit/6292

Note that I can't quite get SK to give me exactly what we need here, so there are a small number that will have to be reviewed to compare Contributions 2 and Contributions 3 dates because they previously had both USD and non-USD donations.

I don't think we have dealt with a mass send like this in the past @Lars , I'm trying to dig up the phab that had a lot of discussion of this happening accidentally (eg person changes countries and donates). I will link it when I find it

Found it, here is where it's happened in the past, looks like they did start hard coding the country to get around the issues we saw before T381437: Donors included wrongly in email send due to "country".

This has been done:

  1. I've reverted the country (and state/province where present) back to the original value for 540 contacts (the credit card and Apple Pay donors, Paypal donors were not affected).
  2. I've reset the Last Currency field appropriately for 1033 contacts. However, because this field is updated by database trigger, if any of the contributions are updated for any reason, the contact's Last Currency will again be set to USD. We don't have any system in place that can prevent that. For the ~60 new monthly donors, they will revert to USD after their next monthly donation.
  3. @krobinson Regarding safeguards, I've talked this over with the team and we unfortunately don't see anything that we can do to prevent this from our end. Is there a discussion to be had here about how we can make sure the links are being tested to make sure they aren't being hard coded?

Thank you so much Lars for all your work here!

Addressing #3, we have since changed how we pull in a donor's country in our hyperlinks. Instead of hardcoding two letter country codes like country=US or country=GB, we now use a donor's country field which in Acoustic is available as country=%%country%%.

At send time that variable gets replaced with what's on file for a contact.

Thanks @ppenloglou. That makes a lot of sense.

Thank you for all of this work @Lars and for the preventative action @ppenloglou .

So the only downstream issue is the recurring donors processing in USD. I don't think we can do much about that, and will just have to deal with the donors if they notice and have issues with that when they get their recurring receipts in January. Some may have been intentional (some CA donors do want to donate in USD for tax purposes) so we shouldn't second guess here.

Thank you! I think this is done :)

XenoRyet set Final Story Points to 2.