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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How to use checksum inside a custom token
Pages: [1]

Author Topic: How to use checksum inside a custom token  (Read 499 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
How to use checksum inside a custom token
February 09, 2014, 02:46:35 pm
I am working on a custom token using the hook "mymodule_civicrm_tokenValues"  that creates a formatted HTML listing of upcoming events, with a link to register for each event.  I would like to use  {contact.checksum} within the link to register, but I cannot figure out how to calculate the checksum within the code for my hook.

I looked at the "contact" API, but it does not seem to return the checksum. I did not see it in the table civicrm_contact either. (Although there is a field there named "hash" I am not sure how that relates to the checksum)

Any ideas on how to use the checksum inside my hook?
« Last Edit: February 09, 2014, 02:56:16 pm by epg »
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: How to use checksum inside a custom token
February 09, 2014, 03:08:35 pm
CRM_Contact_BAO_Contact_Utils::generateChecksum($contactId)
Try asking your question on the new CiviCRM help site.

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: How to use checksum inside a custom token
February 12, 2014, 01:00:08 pm
Thanks, that did the trick
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How to use checksum inside a custom token

This forum was archived on 2017-11-26.