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 (Moderator: Dave Greenberg) »
  • Tokens in CiviContribute HTML thank you and Email Receipt.
Pages: [1]

Author Topic: Tokens in CiviContribute HTML thank you and Email Receipt.  (Read 3983 times)

brandenallmon

  • Guest
Tokens in CiviContribute HTML thank you and Email Receipt.
October 09, 2009, 09:57:09 am
Is there an easy way to get the Tokens to work in the HTML thank you page and the Receipt in my contribution pages?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Tokens in CiviContribute HTML thank you and Email Receipt.
October 09, 2009, 10:31:15 am
Both of these are rendered via "Smarty" templates - so rather than tokens, you would need to see whether the values you want to add are  already available as smarty variables. You can see all available variables by enabling Debugging (Global Settings) adding the smarty value {debug} to the top of each of these templates and then running a test. For the Thankyou page, you'll get a pop-up browser window showing available variables. For the email receipt, they'll be spit out on top of the email.

!!! You should NOT do this in a production / live site.

If the variables you need are there, then you just need to create a custom copy of the templates - adding them where desired.

http://wiki.civicrm.org/confluence/display/CRMDOC/Customizing+CiviCRM+Screens

Else you'll need to implement a hook (pageRun) for the Thankyou page.  I'm not sure if a hook will work for the email receipt - you can discuss on IRC if you're going down this road.

http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification
Protect your investment in CiviCRM by  becoming a Member!

damion

  • I’m new here
  • *
  • Posts: 16
  • Karma: 1
Re: Tokens in CiviContribute HTML thank you and Email Receipt.
September 20, 2010, 12:27:36 am
I'll put in my vote to have the "Receipt Message" text run through the token replacement system.   I understand how other parts of the email receipt that contain transaction info & custom field info need to be spit out via smarty templates.   But enabling the introductory text of receipts to be personalized would standardize their behavior alongside the CiviCRM message templating system and would especially benefit membership renewal / signup where we have obtained user's name for example.  I'll add this to feature request.

P.s. I spent some time looking for the email receipt template (thought it was a php or tpl file), and finally found it here: Mailings > Message Templates > System Workflow Messages > Memberships - Receipt (on-line)
« Last Edit: September 20, 2010, 03:31:16 am by damion »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Tokens in CiviContribute HTML thank you and Email Receipt.
September 20, 2010, 01:30:34 pm
The posts above are obsolete (refer to older versions of CiviCRM). Receipts and other system generated messages are now controlled via System Workflow Message Templates (as you noted).

Most (all?) contact tokens ARE supported in System Workflow Message Templates  - and there's an Insert Tokens widget that's part of editing the message templates which inserts the formatted tokens for you.
Protect your investment in CiviCRM by  becoming a Member!

damion

  • I’m new here
  • *
  • Posts: 16
  • Karma: 1
Re: Tokens in CiviContribute HTML thank you and Email Receipt.
September 20, 2010, 04:21:04 pm
I stand corrected!  Thank you.  I failed to notice the "baby blue" Insert Tokens link.  I will make do with that for now. 

However, I have a few separate membership signup forms, each corresponding to a different membership type.  But it appears they all end up sharing the same receipt form.  So conceptually having the contribution page's "receipt text" be different, and having the tokens replaceable in that is still a bit more elegant, than diving into smarty codes and trying to logic out the different cases by switching the text displayed at the top of the smarty template based somehow on calling contribute page.  So maybe not so obsolete a request after all?

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Tokens in CiviContribute HTML thank you and Email Receipt.

This forum was archived on 2017-11-26.