function pet_substitutions in Previewable email templates 7
Same name and namespace in other branches
- 8.4 pet.module \pet_substitutions()
- 8 pet.module \pet_substitutions()
- 6 pet.module \pet_substitutions()
Load the token objects for a PET template in preparation for token substitution.
2 calls to pet_substitutions()
- pet_make_preview in includes/
pet.admin.inc - Generate a preview of the tokenized email for the first in the list.
- pet_send_one_mail in ./
pet.module - Send one email, with token substitution.
File
- ./
pet.module, line 459 - Previewable Email Template module.
Code
function pet_substitutions($pet, $params) {
$uid = pet_isset_or($params['pet_uid']);
$nid = pet_isset_or($params['pet_nid']);
// Standard substitutions
$substitutions['global'] = NULL;
if (!empty($uid)) {
$user = user_load($uid);
$substitutions['user'] = $user;
}
if (!empty($nid)) {
$node = node_load($nid);
$substitutions['node'] = $node;
}
// Give modules the opportunity to add their own token types/objects
drupal_alter('pet_substitutions', $substitutions, $params);
return $substitutions;
}