Skip to content

Commit

Permalink
Remove calls to replaceContributionTokens
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Sep 18, 2021
1 parent 245b4fe commit c97af7a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions CRM/Contribute/Form/Task/PDFLetter.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,19 +533,19 @@ public static function isValidHTMLWithTableSeparator($tokens, $html) {
* @return string
*/
protected function resolveTokens(string $html_message, $contact, $contribution, $messageToken, $grouped, $separator, $contributions): string {
if ($grouped) {
$tokenHtml = CRM_Utils_Token::replaceMultipleContributionTokens($separator, $html_message, $contributions, $messageToken);
}
else {
// no change to normal behaviour to avoid risk of breakage
$tokenHtml = CRM_Utils_Token::replaceContributionTokens($html_message, $contribution, TRUE, $messageToken);
}
$tokenContext = [
'smarty' => (defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY),
'contactId' => $contact['contact_id'],
];
if ($grouped) {
$html_message = CRM_Utils_Token::replaceMultipleContributionTokens($separator, $html_message, $contributions, $messageToken);
}
else {
$tokenContext['schema'] = ['contributionId'];
$tokenContext['contributionId'] = $contribution['id'];
}
$smarty = ['contact' => $contact];
return CRM_Core_TokenSmarty::render(['html' => $tokenHtml], $tokenContext, $smarty)['html'];
return CRM_Core_TokenSmarty::render(['text' => $html_message], $tokenContext, $smarty)['text'];
}

}

0 comments on commit c97af7a

Please sign in to comment.