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 CiviMail (Moderator: Piotr Szotkowski) »
  • civicrm 4.3.5 tokens & Drupal
Pages: [1]

Author Topic: civicrm 4.3.5 tokens & Drupal  (Read 378 times)

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
civicrm 4.3.5 tokens & Drupal
October 28, 2013, 09:51:48 am
Hi everyone !

I'm experiencing strange behaviors on my CiviCRM 4.3.5 with Drupal 7.

I'm trying to add new tokens and then use them to send renewal reminders to members.

Based on Drupal watchdog function, I succeed doing it, but when the mail is sent my tokens are empty...

I read some articles talking about the boot order in drupal.php but was solved ages ago !

I can't figure it out why... any ideas ?

thx !
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
Re: civicrm 4.3.5 tokens & Drupal
October 29, 2013, 12:57:54 am
I'm using this code

Code: [Select]
function my_function_civicrm_tokens( &$tokens ) {
    $tokens['test'] = array('test.un' , 'test.deux');
}

function my_function_hooks_civicrm_tokenValues( &$values, $cids, $job = null, $tokens = array(), $context = null ){
if(!empty($tokens['test'])){
$values['test.un'] = 'un';
$values['test.deux'] = 'deux';
watchdog('cyim_civicrm_hooks',$values['test.un'].' '.$values['test.deux']);
}
}
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civicrm 4.3.5 tokens & Drupal
October 29, 2013, 01:19:50 am
I think you need to index by contact_id when you add to the values array
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Matthias de MAUROY - CYIM

  • I post occasionally
  • **
  • Posts: 59
  • Karma: 4
  • Working at CYIM
    • CYIM
  • CiviCRM version: 4.4.4
  • CMS version: Drupal 7
  • MySQL version: 5.1.66-community-log
  • PHP version: 5.3
Re: civicrm 4.3.5 tokens & Drupal
October 29, 2013, 07:50:16 am
Thx Eileen !

I just received a test mail with my membership's informations !
Matthias de MAUROY
Analyste Web Developpeur
BU WEB
Tél. : +33 (0)2 99 22 83 40
Fax : +33 (0)2 99 22 83 41
Mail : m.mauroy@cyim.com
CYIM
31, rue de la Frébardière
35135 CHANTEPIE
FRANCE

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • civicrm 4.3.5 tokens & Drupal

This forum was archived on 2017-11-26.