I need to create a custom system workflow message for

Contributions - Receipt (on-line)

that will be used instead of the default template when a particular contribution page is used.

I already know about the Receipt tab of the contribution page wizard. There I can prepend text to the receipt that is unique to that contribution page.

But I need to fuss with the template itself. I know about the System Workflow Messages at: civicrm/admin/messageTemplates. The problem there is that the change applies to all contribution receipts. I'm looking to change the template only for a particular contribution page.

I'm using CiviCRM 4.5.8 on Drupal 7.36.



As I learned from @Nicholai in a previous (unrelated) thread, you can override these templates with some pretty easy logic to add something custom to a single page. For example:

{if $contributionPageID == 20}

{* whatever you need to do on this page *}


I assume this would work in this case, too. If you try it and it works, let us know!

  • 1
    don't you need an {else} eg {if $contributionPageID == 20} DO THIS {else} DO THAT {/if} - i guess you don't if what you are saying for PageID==20 is in addition ;-) – petednz - fuzion Jun 29 '16 at 5:16
  • Sounds about right! – Laryn - CEDC.org Jun 29 '16 at 12:14
  • Can I use this for the message template subject line, so I could have unique subject lines for each contribution form I have? Like this: {if $contributionPageID == 20} {ts 1=$title}Event Registration Receipt: %1{/ts} {elseif $contributionPageID == 21} {ts 1=$title}Membership Receipt: %1{/ts} {elseif $contributionPageID == 2} {ts 1=$title}Receipt for item purchase: %1{/ts} {else} {ts 1=$title}Generic: %1{/ts} {/if} – A. Block Jan 21 '19 at 18:04
  • @A.Block yes. However, you're likely better off using CiviRules to manage your receipts instead. – Jon G - Megaphone Tech Jan 22 '19 at 3:50
  • civiRules sounds interesting. I've installed the extension, and I can see how to set a rule for when a specific contribution form is used, but how do I use it to change the subject line of the receipt message template? – A. Block Jan 22 '19 at 19:16

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.