Fundraising tech/Update Thank You Emails

Jump to navigation Jump to search

Updating Thank You email templates directly in git[edit]

git-review -S
  • Edit the templates using your favorite text editor:
    • Email body templates are in sites/all/modules/thank_you/templates/html and email subject templates are in sites/all/modules/thank_you/templates/subject
    • The language code is the second to last segment in the file names. If a file starts with endowment_ it is only used for endowment-coded donations.
    • Template logic uses Twig. The variables sent to the template are provided by this code. With luck, you won't have to touch anything inside the {% %}.
  • Using a command line, add the changed files to a git commit.
git add sites/all/modules/thank_you/templates/html/thank_you.en.html
git commit -m "Updated English thank you email"
  • Push the commit to gerrit for review (this depends on having git-review installed and configured for the crm repository)
  • If successful, that command should output a link to where you can see the changes.
  • To send a test email, you can pull the commit on to frdev1001. From the gerrit page for your change, click the Download dropdown in the top right, select "anonymous http" in the panel that appears, and copy the second command, labeled "Cherry Pick". Then on frdev1001, paste it into the staging CiviCRM directory, e.g.
 cd /srv/org.wikimedia.civicrm/
 git fetch "" refs/changes/24/513024/1 && git cherry-pick FETCH_HEAD
  • On the Civi staging website, use the "Send test thank-yous" link about halfway down the left side navigation. Select a language and change any relevant options like recurring or endowment, and send yourself a message.
  • If everything looks good, ask someone with merge rights to +2 your change and deploy it to production. Dropping the gerrit link into IRC and saying "fr-tech can you please review this?" is a good way to find someone to do that.

Updating Thank You email templates from (old method)[edit]

  • Run on a development machine with the wikimedia/fundraising/crm installed and configured.
  • cd crm/drupal
  • To update templates for all languages
    • drush -v -v make-thank-you
  • To update just a specific language template
    • drush -v -v make-thank-you --languages=fr
    • Use lower-case version
  • Look for any unconsumed tokens: "Bad news, you have errors." This check can be run separately if you wish, using "drush find-unconsumed-tokens".
  • The changes will be written to sites/all/modules/thank_you/templates/html/ under your wikimedia/fundraising/crm repo
  • Inspect the results and run the test GUI to email yourself if desired, at /admin/config/thank_you/test (no /civicrm prefix here, the TY sender is a drupal module).
  • Submit for review, then merge to the deployment branch.

TODO: document how to update to next year's letter, how to update TY mail subject templates.