$tokenHtml = CRM_Utils_Token::replaceHookTokens($tokenHtml, $contact[$contactId], $categories, TRUE);
if (defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY) {
+ //$debugfile = fopen("/tmp/debug1","w+");
+ //fwrite($debugfile, $tokenHtml);
+ //fclose($debugfile);
+ $tokenHtml = str_replace('<{', '[ss]', $tokenHtml);
+ $tokenHtml = str_replace('}>', '[cs]', $tokenHtml);
+ $tokenHtml = str_replace('{', '[ob]', $tokenHtml);
+ $tokenHtml = str_replace('}', '[cb]', $tokenHtml);
+ $tokenHtml = str_replace('[ss]', '{', $tokenHtml);
+ $tokenHtml = str_replace('[cs]', '}', $tokenHtml);
$smarty = CRM_Core_Smarty::singleton();
// also add the contact tokens to the template
$smarty->assign_by_ref('contact', $contact);
$tokenHtml = $smarty->fetch("string:$tokenHtml");
+ $tokenHtml = str_replace('[ob]', '{', $tokenHtml);
+ $tokenHtml = str_replace('[cb]', '}', $tokenHtml);
}
$html[] = $tokenHtml;