Page MenuHomePhabricator

Civi: EOY Auto Thank You Email Receipt - New content is ready for coding
Closed, ResolvedPublic8 Estimated Story Points

Description

Hi, We have new approved content for the EOY receipt email. Here is the folder for all translations: https://drive.google.com/drive/u/0/folders/1ivcIhmbwcrZlXwuSfqyIDkExyB_1SlCC

It's been brought to my attention that the Civi Email Template UI may be ready the week of Sept 13th, so we may not need fr-tech's involvement in coding these. However, I'm filing this task anyway as a means to stay organized so folks can follow what's going on, as well as just in case we need assistance with something we can't edit ourselves.

Linking this retro catchall task (T271883) for easy reference, so we can review the "Formatting" section for improvements.

The priority is to get these up and running before December if possible, with English going live first.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 736310 merged by Eileen:

[wikimedia/fundraising/crm@master] Move tests into the extension

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

Change 737829 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Throw exception before trying to render rather than in render

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

Change 737833 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Move rendering into the render function

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

Change 737829 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Throw exception before trying to render rather than in render

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

Hi @Ejegg ! I have a last minute edit to request for the Hungarian EOY Thank You email please. We got some really late feedback from the Hungarian reviewer (community/chapter member) who mentioned the first paragraph of the email is problematic now in Hungary due to the recent Pegasus scandal.

The edit would involve simply deleting the first paragraph of the body of the email. I have made the edit in suggestion mode in the respective google doc. Please let me know. Thank you!

Camille

@CDenes_WMF no worries - you'll be able to tweak them in the UI once we put them up too

Hi @Eileenmcnaughton. Since it's officially mid-November, just checking in on the status of these. Are we at a place where I can pass the ball to @CDenes_WMF for post-code translation review? Thanks!

Change 737833 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Move rendering into the render function

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

Change 739026 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Add first 2 templates that can be rendered via new system

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

Change 739041 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Add a bunch of translations

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

@KHaggard @CDenes_WMF - the templates are on staging now - https://civicrm.frdev.wikimedia.org/civicrm/admin/messageTemplates?reset=1#/workflow?f=%7B%22text%22:%22year%22%7D - and we hope to transfer them to live tomorrow.

You can preview them on staging but it's worth waiting until they are on prod before doing any real QA - since you'll be able to make the changes directly through the UI on production (and approve them once you are happy with them). We can show you how to do that (ping @XenoRyet )

Note that a lot of translators left the word 'on' in the table - I left it out in those translations rather than put the English word in. I read the instructions to them & can see how they would have thought they should leave it

Thanks @Eileenmcnaughton - Makes sense to me to wait until they are on prod before continuing with QA. Does that sound good to you, @CDenes_WMF ?

Change 739346 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Use contribution.amount rather than total_amount in the templates

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

Change 739026 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Add first 2 templates that can be rendered via new system

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

Change 739382 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Use contribution.amount rather than total_amount in the templates

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

Change 739041 abandoned by Eileen:

[wikimedia/fundraising/crm@master] Add a bunch of translations

Reason:

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

Change 739346 abandoned by Eileen:

[wikimedia/fundraising/crm@master] Use contribution.amount rather than total_amount in the templates

Reason:

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

Change 739382 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Use contribution.amount rather than total_amount in the templates

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

The templates are all on production here - I'm looking into the wrong decimal point being used where '.' is not correct (eg. Danish) but that is a code level not template level fix

Change 739395 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm/civicrm@master] Fix mix-up of shift & unshift

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

Change 739395 merged by jenkins-bot:

[wikimedia/fundraising/crm/civicrm@master] Fix mix-up of shift & unshift

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

Change 739653 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Switch render to use the workflow message template

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

Thank you very much @Eileenmcnaughton ! This link in your comment above is not working for me. Could you please let me know how best to proceed?

RE 'making changes directly': I chatted with Dylan this week at fr-tech office hours. If we have enough time between now and the send date, we can try to get the training done and implement the edits ourselves; however, if it ends up being too tight (very possible), we'll need to bounce it back to y'all for implementing any edits. I'll keep you posted on our timeline. Thank you!

CC @KHaggard FYI ^

Kind regards, C

@CDenes_WMF when you say 'not working for you' - is it giving you a permissions error?

This is what I see

image.png (782×2 px, 124 KB)

UPDATE - I just checked & you had the 'Donor Services' role - I gave you the 'CiviCRM Admin' role which should give you permissions now & we can figure out any permission tweaking for Donor Relations later.

Great, thank you! I've never used this webpage before, a few questions:

  • Is there a way to send myself the email (the same way we use Testmeister) so I see the emails in their final form? That is-- without the code visible? That is typically how we do post-coding proofing
  • Do I need to click on "current" or "draft"? What's the difference between the two?
  • Is "standard" = "English"?
  • What's the difference between the two rows of "standard"?

@CDenes_WMF so all of those languages only have a draft version at the moment - if you click on the draft versions you can look at them, edit them, preview then and activate them (at which point they become 'current' and are 'live') - Look for the little eye for preview

image.png (92×306 px, 3 KB)

Note you will be able to send yourself test emails from your own contact record - we are working on fixing up the action 'Send Annual Thank you letter' on the bottom right to use the new templates

image.png (890×732 px, 112 KB)

Re standard - yes it's English / default. You can probably ignore the second row of that for now.

You can also see all the recurring failure emails

image.png (676×1 px, 95 KB)

Great, thanks for all the details Eileen!

One more question, it looks like the math is wrong in this preview:

Screen Shot 2021-11-17 at 15.41.10.png (242×404 px, 33 KB)

Is this intentional?

@CDenes_WMF wow - that was super sharp of you! We didn't spot that & it was only when hitting another bug last night I realised that a contribution in the sample data was being 'lost' - let me push out the fix for that & see if it fixes the sample data.

I pushed out that fix - hopefully the totals are improved...

Thank you for all of the word on this! Can @MBeat33 and I please get some of the test emails sent our way once these are ready so we can do a review? Or would it be possible for @MBeat33 to be able to test some himself? We picked up on so many of the issues in previous years, it would put us at ease to be able to do some tests too!

Cheers :)

@Eileenmcnaughton could you please grant @TomaszGorski the same 'CiviCRM Admin' role? He is on the Localization team and will need it for post-coding review. TY!

@CDenes_WMF done - @krobinson - you can already see them in the UI as a preview at the url https://civicrm.wikimedia.org/civicrm/admin/messageTemplates?reset=1#/workflow?f=%7B%22text%22:%22year%22%7D - we will also make it possible to preview through the end of year email action soon

Hello @Eileenmcnaughton Thank you, I can see the templates and start the post-coding review.

Going through the templates, I’ve noticed that Hebrew version doesn’t have “<div dir=“rtl”>” at the beginning and “</div>” at the end. Doing the preview mode, I can see that the EOY doesn’t seem to appear Right to Left. Should it be added like in the "Recurring Failure Email" (see screenshots attached)?

Screenshot 2021-11-19 at 14.40.56.png (426×2 px, 84 KB)

Screenshot 2021-11-19 at 14.41.58.png (432×2 px, 80 KB)

Screenshot 2021-11-19 at 14.44.19.png (588×2 px, 352 KB)

Hello @Eileenmcnaughton We also had the Traditional Chinese translation, can it be added? Here is the Google Doc. Let me know if you have any doubts/comments, cheers,

@TomaszGorski any fixes you see you can actually make directly in the UI you are looking at (which is the same way I would edit it). I couldn't figure out the Hebrew for the recurring email but @Cstone (or @XenoRyet ) figured it out so maybe Christine can update this task with a how-to on that.

Regarding Chinese translations - you are saying that you want to replace the text in the Chinese translation with the traditional one? Or that you want both versions in use - if the latter - how would we know which version to send out? We only have one version of Chinese for the thank you email - @Ejegg do you know how we would know.

@TomaszGorski for Hebrew I added that div for the recurring failure email so yeah you can add it to this one. It doesn't affect the email just makes it appear RTL in the preview

@Eileenmcnaughton we only want Chinese-Traditional; however, there is currently no Chinese email present in the UI tool (neither traditional nor simplified)

@CDenes_WMF argh I had the language code as 'zn_CN' not 'zh_CN'

It's visible now & you can edit it in the UI if I used the wrong one of the google docs.

Note that if you get to the point where a given language is correct then you can click on

image.png (118×460 px, 7 KB)

(Some of them are currently showing an untranslated version as 'current' - those will disappear once the draft is activated).

Change 740930 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Fix Chinese short-name

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

Thanks Eileen! Do you mind please re-coding the Chinese email to take from the Chinese-Traditional copy (instead of the currently Chinese-Simplified)? I don't feel comfortable yet having myself or Tomasz re-doing the entirety of the email/code without first undergoing any training. Please let me know if that' OK with you.

Thank you!
Camille

Change 740930 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Fix Chinese short-name

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

@CDenes_WMF I'm not sure what you mean by recoding? All I would do to change the text is copy the text, paragraph by paragraph, into the relevant places in the screen you are looking at - there isn't any coding involved in updating the text?

@CDenes_WMF maybe we should jump on a hangout & just do the updates together?

Change 739653 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Switch render to use the workflow message template

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

Hello @Eileenmcnaughton,

Help/Advice needed:
For Hebrew, (for visibility @Cstone and @XenoRyet), I have added the <div dir=“rtl”> and</div> in the Hebrew draft but the preview still doesn't show up as right to left but left to right, see screenshot below

Screenshot 2021-11-29 at 12.35.35.png (356×2 px, 209 KB)

Can you please advise?

FYI:
For Chinese, I changed the entire text to be in Traditional instead of Simplified without any issues.

Almost all languages have been proofread and the minute changes saved on the drafts. I did not activate any at this point though.

Hello everyone,

We also received the following feedback from proofreaders:

  • Currency Code is on the left but should be on the right,
  • Number format is 1,000.00 but should be 1.000,00 and
  • Date format is YYYY-MM-DD but should be DD-MM-YYYY

This feedback has been received for the following languages (basically Europe):
Catalan, Danish, German, Spanish Spain, French France, Hungarian, Italian, Latvian, Macedonian, Norwegian Bokml, Dutch, Polish, Portuguese Portugal, Romanian, Slovak and Swedish

Unless mistaken, as is done within the Thank You Email code, can we do automatic currency formatting based on Unicode CLDR standard for number formatting and date?

Many thanks in advance,

For Hebrew it looks like the " in <div dir="rtl"> got turned into fancier ones that HTML doesn't recognize. I switched the " and it's showing up RTL now

@TomaszGorski so there are 3 parts to this

  1. placement of currency code - this is actually part of the template (per language) - ie

Donation {$index}: {$contribution.amount} {$contribution.currency} {$contribution.receive_date}

Might need to be the following for some currencies

Donation {$index}: {$contribution.currency} {$contribution.amount} {$contribution.receive_date}

  1. The currency separators (commas instead of decimal points) - this is definitely in my court. For some reason it's not doing it right & I'm looking into it
  1. The date formatting - we use this location-agnostic formatting in other places too (the thank you letter from the looks). I just want to check what the process is around approving this change (I'm not sure what work is involved in changing)

Chiming in here around the Date formatting point. We have YYYY-MM-DD in the original document that was approved. Also it's the universal date format as Eileen mentioned, so it would make sense to me to keep it consistent for all countries.

However, I also want to check in with @TomaszGorski @CDenes_WMF and @TSkaff - Would keeping the YYYY-MM-DD format significantly block anything that I'm not aware of?

Change 742590 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm/civicrm@master] Short-term fix around displaying localised formatting

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

Hello @Eileenmcnaughton ,

Thank you so much for looking into the dot/comma. The placement of the currency code has been updated in the mentioned languages accordingly for the sentences where it was not the case yet (on the right).

For the Hebrew version, I can see it properly now (thank you @Cstone !) and notice one main issue (see screenshots attached):

  • The Total amount sentence doesn't have the year and amount appearing (הסכום הכולל של התרומות שלך בשנת {year$} היה {total.currency$}{total.amount$}.)

Screenshot 2021-11-30 at 18.03.04.png (70×696 px, 24 KB)

  • The Donation "history" seems to appear in the wrong order for date and amount ( תרומה {index}: ‎{$contribution.amount} {$contribution.currency} {$contribution.receive_date})

Screenshot 2021-11-30 at 18.03.11.png (276×512 px, 72 KB)

Second point edited following feedback from proofreading: "The donation history with USD and CAD is perfectly readable."

Hi all, I sent a test email to my personal email. It lists the AF donations, but retains the Endowment donations summary line even when there weren't any:

for T290253.png (458×708 px, 64 KB)

Would it be possible to add code so that the summary for Endowment donations is only added if there are any? It might reduce donor confusion. If I can spin off into a smaller sub-Task please let me know. Thank you!

@MBeat33 I actually thought that endowment thing was odd too so I added a couple of variables to make it easy to alter the text based on whether they are are present

  • hasEndowment
  • hasAnnualFund

So it would look like

{if $hasEndowment}
  endowment specific stuff
{/if}

or

{if $hasAnnualFund}
  AnnualFund specific stuff
{/if}

The hebrew stuff @Cstone is coping with better than I am,...

Hi there, thank you @KHaggard for chiming in. Double checking with Donor Relations/Kristie, we have not seen push back on that from Donors last year, so it is at this point just proofreader's feedback.

The date formatting is fine as is and not critical to make any changes to it.

Hi everyone, just to confirm that all translations have been proofread and all corrections of typos/errors from a language point of view have been saved directly in the Civi templates.

Only remaining visible issue from the previews of the templates is in Hebrew: "The Total amount sentence doesn't have the year and amount appearing (הסכום הכולל של התרומות שלך בשנת {year$} היה {total.currency$}{total.amount$}.)"

Screenshot 2021-11-30 at 18.03.04.png (70×696 px, 24 KB)

@TomaszGorski if you click activate draft on all the ones you are happy with then they will be usable in the UI (on the very off chance DS is sending out any summaries manually before the end of the year or just for @MBeat33 to be able to see) - it might also be a good way to distinguish between the ones you're happy with and the others (actually only one). In future years there will be a live one & a draft one & activating the draft will replace the live one but at the moment activating the draft just replaces there not being a localised one.

@TomaszGorski they needed the $ infront of the name like {$year} instead of {year$} . I switched them they should be showing up correctly in the draft now

@Cstone Thank you, all showing up correctly in Hebrew in preview. @Eileenmcnaughton Thank you for the explanations! All activated they are.

@TomaszGorski @MBeat33 @krobinson

I just fixed a caching issue and you can now see the preview for individual emails in the UI action under the action to send a thank you - if you right click & open in a new tab you get a link like this one https://civicrm.wikimedia.org/civicrm/send-annual-ty-email?reset=1&cid=10827232

Note that the text will only pre-fill for 'last year' - if you try to use the button on a contact with donations last year (currently 2020) then you will see it pre-fill the year as the default and load the text - otherwise it WILL NOT do either

image.png (282×744 px, 24 KB)

@Eileenmcnaughton many thanks for the hasEndowment & hasAnnualFund code from last Tuesday.

I am running into an issue with testing on live Civi. I'm changing my language preferences at cid=26220292 and selecting Action: Send Annual Thank You Letter, and Civi is hanging and not sending the email:

EoYTY tst 2021-12-07 at 11.03.27 AM.png (1×1 px, 319 KB)

I get the spinning green triangle, and I tried this for 2021 and 2020 contribs separately. Is there another way I can test these emails?

@MBeat33 - OK I see that - I'll get it fixed - it's actually working for me locally oddly enough

Error: Call to undefined function wmf_eoy_receipt_run() in CRM_Sendannualtyemail_AnnualThankYou::send() (line 23 of /srv/org.wikimedia.civicrm/drupal/sites/default/civicrm/extensions/wmf-thankyou/CRM/Sendannualtyemail/AnnualThankYou.php).

Oh - I see - the old module was still being used here. I re-enabled for now @MBeat33 you should have just gotten an email...

Got it, thanks, @Eileenmcnaughton. @TomaszGorski you should be hearing from Jimmy in many languages about now.

@MBeat33 @TomaszGorski I just made an update to the English template to only use the 'Dear Michael' if there is a first & last name (which we do with the other templates. I put in the 'else' tag in case you want to add an alternate - like other languages have

<p>
  {if '{contact.first_name}' && '{contact.last_name}'}
    Dear {contact.first_name},
  {else}
***You can add alternate text here****
  {/if}
</p>

Thank you @Eileenmcnaughton - @SHust I know that many US donors have asked us to resend receipts with full names for tax deduction. In your view would we want to keep the full names, if possible?

@MBeat33 and @Eileenmcnaughton --> YES! It would be great for US donors, and take care of the task of having DR agents do it manually!

@MBeat33

{contact.display_name} will output the display name as we see if in civicrm

Change 742590 merged by jenkins-bot:

[wikimedia/fundraising/crm/civicrm@master] Short-term fix around displaying localised formatting

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

@Eileenmcnaughton Hello Eileen. We have just one last little hiccup with Norwegian left. When Michael tried to send to himself the EOY receipt, all languages worked good except for Norwegian:

When selecting, "Norwegian" (NO), it does send it in Norwegian. But when the donor has "Norwegian Bokmål" (NB), it comes out in English, which can be an issue as the offical language code for Norwegian donors is NB and not NO.

I think this might be related to the fact that the template is under "no_NO" (https://civicrm.wikimedia.org/civicrm/admin/messageTemplates?reset=1#/edit?id=310&lang=no_NO), and should be under "no_NB" too (https://civicrm.wikimedia.org/civicrm/admin/messageTemplates?reset=1#/edit?id=310&lang=no_NB). Can you please help? I've already added the text in Norwegian under that URL with no_NB at the end

But I think it should be associated with a "locale" name (see screenshot) that I do not know how to update.

Screenshot 2021-12-10 at 14.16.06.png (476×2 px, 230 KB)

If you can't find the language name, it might be because it could be written in Civi in an odd way (see this screenshot).

Screenshot 2021-12-10 at 14.19.07.png (90×690 px, 17 KB)

Many thanks in advance for everything,

Hey all, specifically @TomaszGorski

FYI @TSkaff @KHaggard

@Ppena wanted me to confirm that this doc with legal notes had been included in the EOY email:
https://docs.google.com/document/d/1nVcYH8GmlpZvdf04QRwRa4_EZUl6DtIJVxacN_AlRbU/edit

I see it linked in the google drive folder in the body of this task so I assume has been included but I think she was looking for confirmation.

Change 746032 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm@master] Default year to 'last year'

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

@Ppena wanted me to confirm that this doc with legal notes had been included in the EOY email:
https://docs.google.com/document/d/1nVcYH8GmlpZvdf04QRwRa4_EZUl6DtIJVxacN_AlRbU/edit

I see it linked in the google drive folder in the body of this task so I assume has been included but I think she was looking for confirmation.

Hi @DStrine - That document is the EOY email original doc that I handed off to Camille and Tomasz to create the translations.

Thanks all! I'm a bit unclear on what we mean by "included" ? That's the document with the English source text. If you scroll down to page 2 you'll see the version for translations (i.e. "For Non-English Translations - Removing Endowment Language"), and that' exactly what we had translated into all these languages. If Pats just wants to makes sure that we followed that text, then yes... but otherwise please let me know.

Per the standup today, it sounds like this task can be resolved. correct?

I have been testing on staging and found that there was a problem with apostrophes in names - I have updated the 3 languages I hit problems in to use a slightly more complex syntax {if "'{contact.first_name}'" !== '' && "'{contact.last_name}'" !== ''}

e.g

{if "'{contact.first_name}'" !== '' && "'{contact.last_name}'" !== ''}
Bonjour {contact.first_name},

{else}
Cher donateur, chère donatrice,
{/if}

I am running through them on staging & have 'sent' (within the server) around 40k emails so far (I have hit 4 with the problem ^^) & the rest seem OK

It's possible to see the content here https://civicrm.frdev.wikimedia.org/civicrm/eoy (from the created activities )

ALso note my timings on staging are around 400 letters per minute. There are around 560k emails (remember these are only recurring donors) and I think it would take between 24 and 30 hours on a round-the-clock basis (we might wind up losing some time for other jobs or just gap between jobs but in that ballpark)

Batch sizesecondsMinutespercent each runNumber runsTotal time minutesin hours
100001592271.67%60159226.5333333333333
5000753130.83%120150625.1
100014320.17%600143023.8333333333333
200031550.33%300157526.25
100001647271.67%60164727.45

Total emails 600000

Change 746032 merged by jenkins-bot:

[wikimedia/fundraising/crm@master] Default year to 'last year'

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

Change 751848 had a related patch set uploaded (by Eileen; author: Eileen):

[wikimedia/fundraising/crm/civicrm@master] Add end of year thank you template and example code

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

Change 751848 merged by Eileen:

[wikimedia/fundraising/crm/civicrm@master] Add end of year thank you template and example code

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