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) »
  • Token processing in CiviContribute Thank You emails
Pages: [1]

Author Topic: Token processing in CiviContribute Thank You emails  (Read 992 times)

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Token processing in CiviContribute Thank You emails
August 24, 2009, 04:05:45 pm
I'm trying to get the token replacement hooks to work with CiviContribute thank-you emails, and AFAICT, token replacement does not yet occur in these emails:  it gets processed directly by Smarty, it appears, without calling the hooks.

Am I correct about this?  And if so, would you folks accept an implementation for 3.0 or soon thereafter?

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Re: Token processing in CiviContribute Thank You emails
August 24, 2009, 04:23:31 pm
I'm wondering if the right place to add token processing is around line 1158 in CRM/Contribute/Form/Contribution.php

Code: [Select]
  //send receipt mail.
            if ( $contribution->id && CRM_Utils_Array::value( 'is_email_receipt', $formValues ) ) {
                $formValues['contact_id']      = $this->_contactID;
                $formValues['contribution_id'] = $contribution->id;
                $sendReceipt = CRM_Contribute_Form_AdditionalInfo::emailReceipt( $this, $formValues );
            }

acting upon $formValues, or within CRM_Contribute_Form_AdditionalInfo::emailReceipt().  The format of the argument to the token hooks is not exactly the same, so I'd have to pack it up and unpack it, but it looks like the right place to do this.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Token processing in CiviContribute Thank You emails
August 24, 2009, 06:16:15 pm

So none of the receipt code (contribution or event reg) does any token substitution. I would probably do all the token evaluation in the emailReceipt function. I'd also do the same for event registration

Since 3.0 is on its way out, i suspect this will make it into core in 3.1 or so

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Token processing in CiviContribute Thank You emails

This forum was archived on 2017-11-26.