How do I invoke token substitution with Pet?
I've solved in this way:

// SOSTITUZIONE TOKEN DRUPAL
$l_oPetTemplate = pet_load('test1');
$l_TemParams2['pet'] = $l_oPetTemplate;
$l_aSubstitutions = pet_substitutions($l_oPetTemplate, $l_TemParams2);
$l_aEmailParams['email_subject'] = token_replace($l_oPetTemplate-&gt;subject, $l_aSubstitutions, array('clear' =&gt; TRUE));
$l_aEmailParams['email_body']=token_replace($l_oPetTemplate-&gt;mail_body, $l_aSubstitutions, array('clear' =&gt; TRUE));