CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • $50 Bounty for Solution: Token Substitution In Receipt Emails
Pages: [1]

Author Topic: $50 Bounty for Solution: Token Substitution In Receipt Emails  (Read 901 times)

jimmyjam

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
$50 Bounty for Solution: Token Substitution In Receipt Emails
July 16, 2010, 03:48:06 pm
It's easy to do token substitution in receipt emails by modifying the appropriate message template.

BUT... I have two different contribution pages that each need its own receipt email with its own tokens. Both contribution pages use the same message template, so they end up getting the same email receipt.

My question is: How do I send a unique messages (with unique tokens) for each of my contribution pages? For example, is there a way to evaluate the contribution page ID in the message template, and use message A for ID=1 and message B for ID=2?


Thanks,
James

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: $50 Bounty for Solution: Token Substitution In Receipt Emails
July 16, 2010, 10:06:43 pm
James - no idea if this helps, (warning, in my case a little knowledge is definitely a dangerous thing) but we have a Contribution receipt going out where we need different headers etc based on which of the Domain IDs is being used (this is a multisite implementation) - so I am just posting this to show that 'if' statements like those below work in the context of Contribution Message Templates, in case it suggests that similar simple solution might suffice for swopping out the tokens you are wanting based on "if  Contribution Page ID = xx insert this token end if"
Code: [Select]
{if '{pirg.id}' eq '1' }
   <!-- This Section for XXX -->
    <tr><td><h1>Thank you for donating to the XXX</h1>
    <img  src="http://greens.org.au/misc/greenslogo-pms375-196x170.png">
    {* <img  src="/var/www/d6c22-html/sites/vic.greens.org.au/greenslogo-pms375-196x170.png"> *}</td>
</tr>
{/if}

{if '{pirg.id}' eq '2' }<tr><td>
   <!-- This Section for YYY -->
    <tr><td><h1>Thank you for donating to the YYY</h1>
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

jimmyjam

  • I post occasionally
  • **
  • Posts: 87
  • Karma: 4
Re: $50 Bounty for Solution: Token Substitution In Receipt Emails
July 18, 2010, 08:54:17 pm
Thanks Peter!  Now I just need to figure out how to reference the contribution page ID.

I'll let you know what I discover.

James

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • $50 Bounty for Solution: Token Substitution In Receipt Emails

This forum was archived on 2017-11-26.