You are here

function hook_pet_substitutions_alter in Previewable email templates 7

Same name and namespace in other branches
  1. 8.4 pet.api.php \hook_pet_substitutions_alter()
  2. 8 pet.api.php \hook_pet_substitutions_alter()
  3. 8.3 pet.api.php \hook_pet_substitutions_alter()

Add custom token objects.

Modules can implement this hook to provide additional token objects for substitution by PET during an email send.

Related topics

1 invocation of hook_pet_substitutions_alter()
pet_substitutions in ./pet.module
Load the token objects for a PET template in preparation for token substitution.

File

./pet.api.php, line 28
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_pet_substitutions_alter(&$substitutions, $params) {

  // Make my tokens available to PET
  if (isset($params['node']) && $params['node']->type == 'something_or_other') {
    $substitutions['something_or_other_extra_tokens'] = MY_MODULE_something_or_other_extra_tokens($params['node']);
  }
}