* @return string
* @throws \CRM_Core_Exception
*/
- public function generateHtml(&$contact, $contribution, $groupBy, $contributions, $realSeparator, $tableSeparators, $messageToken, $html_message, $separator, $grouped, $groupByID) {
+ public function generateHtml($contact, $contribution, $groupBy, $contributions, $realSeparator, $tableSeparators, $messageToken, $html_message, $separator, $grouped, $groupByID) {
static $validated = FALSE;
$html = NULL;
CRM_Core_Session::setStatus(ts('You have selected the table cell separator, but one or more token fields are not placed inside a table cell. This would result in invalid HTML, so comma separators have been used instead.'));
}
$validated = TRUE;
- $html = str_replace($separator, $realSeparator, $this->resolveTokens($html_message, $contact, $contribution['id'], $grouped, $separator, $groupedContributions));
+ $html = str_replace($separator, $realSeparator, $this->resolveTokens($html_message, $contact['contact_id'], $contribution['id'], $grouped, $separator, $groupedContributions));
}
return $html;
/**
*
* @param string $html_message
- * @param array $contact
+ * @param int $contactID
* @param int $contributionID
* @param bool $grouped
* Does this letter represent more than one contribution.
*
* @return string
*/
- protected function resolveTokens(string $html_message, $contact, $contributionID, $grouped, $separator, $contributions): string {
+ protected function resolveTokens(string $html_message, int $contactID, $contributionID, $grouped, $separator, $contributions): string {
$tokenContext = [
'smarty' => (defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY),
- 'contactId' => $contact['contact_id'],
+ 'contactId' => $contactID,
'schema' => ['contributionId'],
];
if ($grouped) {