Page MenuHomePhabricator

Add currency symbol to email export file
Closed, ResolvedPublic2 Estimated Story Points

Description

One of the greatest levels of complication in our emails is supporting a set of rules to display the donor's past donation amount. Because we always have edgecases where a donor might have given in a non-native currency (say, ILS in enUS), every email has rules to display every currency symbol we support.

This is done by nesting multiple rulesets within one another to tell Silverpop a) the right symbol to display based on the currency code and b) where to put the currency symbol (right or left of the amount). If the currency symbol was already present in Silverpop, we could get rid of 1 layer of sophistication, making my live a lot easier, and making us less reliant on Silverpop specifically for its dynamic content tools.

Event Timeline

ggellerman moved this task from Triage to Q3 2021-2022 on the Fundraising-Backlog board.

Change 381351 had a related patch set uploaded (by Ejegg; owner: Ejegg):
[wikimedia/fundraising/tools@master] Add lastet_currency_symbol to export

https://gerrit.wikimedia.org/r/381351

Ooh @Ejegg, will this also be in tomorrow's import? Is this replacing the
ISO codes currently in the currency fields, or is it a new field?

It'll be a new field, but I haven't gotten any review on it yet.

I'm getting the values from the civicrm_currency table, which has NULL in some rows for more obscure currencies. Would it make sense to have the new field fall back to the ISO code when the civicrm_currency symbol is NULL, or would you rather have the new field blank so you can use your own logic to fill stuff in?

Change 381351 merged by jenkins-bot:
[wikimedia/fundraising/tools@master] Add lastet_currency_symbol to export

https://gerrit.wikimedia.org/r/381351

@CCogdill_WMF Got this reviewed! I can deploy it this evening if you have time to update the mappings for the Silverpop-side import. The new column will be right after 'latest_currency'

@Ejegg thanks! I think I actually need more info on where this currency
comes from. We rely on latest_currency for most of our rulesets in the
email, so I want to ensure this is pulling from the same place.

Don't wait for me to add fields to the import -- I'm not able to remap it
until the new file is online, so I've turned off tonight's import and will
remap it by hand tomorrow.

Ah, thanks for clarifying the import process! I always though the mapping had to be set up first.

The latest_currency field will still get exactly the same ISO codes it was getting before. The new 'latest_currency_symbol' field is coming from the 'symbol' column of the 'civicrm_currency' table. You can take a look at it in the frdev database if you want to double check the symbol mapping and see which ones might be missing. For currencies that either aren't in that table or have NULL in the symbol column, I'm putting the 3 letter ISO code in 'latest_currency_symbol', meaning it will match 'latest_currency'.

Running the job now, should take 45 mins or so. I'll let you know!

Confirming these look good. Thanks so much!