We collect a lot of data from people who buy a membership using a Contribution Page. The confirmation/thank you email includes all of that data, which is a problem: some of the data we collect is not suitable for being emailed.

Is there a way to restrict/limit/choose what fields are included in the thank you emails for this contribution page?

We're on 5.24.3.


It looks possible by editing the Workflow Message Template for online receipts. (Thanks @RebeccaTregenna for hint) This is written in Smarty code.

There are two options:

  1. Remove all customPre and customPost sections.
  2. Add logic to identify the fields you don't want and filter those out.

Making these changes is difficult, it's code with logic, there's no validation either, so easy to make a mistake or delete the wrong bit. So save a copy of the original version before you make changes!

I went for (1) for the time being because we had so many extra fields that just listing them would have been time consuming. Also, as we can only filter on the field's label, were anyone to tweak that slightly the logic would fail and that would start getting output without us knowing. Also, I wasn't sure any of the fields were really needed in the receipt, so I took a conservative approach (as in erred on the safe side, as opposed to a Conservatives approach which is to err on the unsafe side and not take coronavirus seriously until it's too late)

Looking at the template code, it already includes code for selectively removing fields defined in a $trackingFields array, however I can't see that that is ever defined anywhere.

  • LOL 12345678910 (stupid limit of minimum characters) – petednz - fuzion Apr 25 '20 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.