Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-7256

hook civicrm_tokens is never implemented when emailling contribution receipt

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 3.2.5
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I'm implementing a hook token module, but doesnt seem to be working, based on http://civicrm.org/node/637

      In my message template for memberships ive added "hello {$test.hello}" to both online and offline

      I can see the function is being called because /tmp/tokens.txt gets created when i purchase a new Membership Contribution,

      function civi_custom_membership_civicrm_tokens( &$tokens ) {
      $tokens['test'] = array( 'test.hello' );
      }

      function civi_custom_membership_civicrm_tokenValues( &$values, &$contactIDs, $jobID ) {

      if ( is_array( $contactIDs ) ) {
      $contactIDString = implode( ',', array_values( $contactIDs ) );
      $single = false;
      foreach ($contactIDs as $contact)

      { $values[$contact]['test.hello']= "Hello world!"; }


      } else

      { $single = true; $values['test.hello'] = "Hello world!"; }

      file_put_contents("/tmp/token.txt","was ran");
      }

        Attachments

          Activity

            People

            • Assignee:
              lobo Donald A. Lobo
              Reporter:
              dgtlmoon leigh morresi
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: