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 the API in message templates
Pages: [1]

Author Topic: How to use the API in message templates  (Read 550 times)

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
How to use the API in message templates
June 19, 2012, 04:19:33 am
I need to create some specific message templates (to be used as a template for a PDF letter) in which I want to use the API....can I actually do that or do I need to use the token hooks to make tokens available first? Does anyone have an example? I have tried this (version 2 API wiht CiviCRM 3.3.5) but it does not seem to do anything:
Code: [Select]
{crmAPI var=contactDetails entity=Dgwcontact action=get contact_id=contact.contact_id}
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: How to use the API in message templates
June 19, 2012, 04:42:33 am
Hi,

I'm assuming dbwcontact is a custom entity?
 (would be great if you do a session around these tricks at civicon :)

Is smarty working on you templates? can you try a {if } something ?
I think there is a config on the civicrm.settings to enable it (I think it's by default, but not sure)

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: How to use the API in message templates
June 19, 2012, 05:50:01 am
dgwcontact is the specific API wrapper for De Goede Woning :-) I can do a session around these trics, but I feel I am mainly using old fashioned tricks as it is version 2 API......(upgrade to Drupal 7 and Civi API 3 planned for next year). However, I will suggest a session on synchronization of data at De Goede Woning, see how many takers we get :-)

On the templates, I will check the config file and update this post once I did, thanks!
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • How to use the API in message templates

This forum was archived on 2017-11-26.