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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Retrieving a contrib id it the hook_civicrm_tokenValues
Pages: [1]

Author Topic: Retrieving a contrib id it the hook_civicrm_tokenValues  (Read 1319 times)

j.benit

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 3.4.7
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Retrieving a contrib id it the hook_civicrm_tokenValues
November 30, 2011, 03:06:49 am
Hi all, i'm finding very limited the hook_civicrm_tokenValues in the way i only have access to contact ids.

The point is, when i send an email with a receipt containing the specific information of a contribution, i would like to have the possibility to access to the contrib id value in relation with that receipt in my hook_civicrm_tokenValues, but i only have access to contact ids... so i can retrieve information in relation with all the contributions for that contact id/s, but how can i retrieve the info of an specific contribution of that contact? i want to access only to the contribution related with that receipt

Thanks a lot for your time.

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: Retrieving a contrib id it the hook_civicrm_tokenValues
November 30, 2011, 06:02:52 am

4.1 has some improvements to the tokenValues hook, but we still dont send in "enough context" information.

If you can take a look at 4.1 and figure out how to extend it to send context info that would be great

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

j.benit

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 3.4.7
  • CMS version: Drupal 6
  • MySQL version: 5
  • PHP version: 5
Re: Retrieving a contrib id it the hook_civicrm_tokenValues
December 01, 2011, 06:00:04 am
It should be very useful to have the context entity id. For example: if a hook token is being called when the system sends an email which uses a template for membership (for example a membership renewal reminder), that parameter should contain the membership type id, if the template is related with a contribution, the contrib id...

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: Retrieving a contrib id it the hook_civicrm_tokenValues
December 01, 2011, 02:46:43 pm

agreed. Having the context and the relevant ids would be very useful indeed

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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Retrieving a contrib id it the hook_civicrm_tokenValues

This forum was archived on 2017-11-26.