$from = "$fromDisplayName <$fromEmail>";
}
- $returnProperties = [];
- if (isset($messageToken['contact'])) {
- foreach ($messageToken['contact'] as $key => $value) {
- $returnProperties[$value] = 1;
- }
- }
-
- if (isset($subjectToken['contact'])) {
- foreach ($subjectToken['contact'] as $key => $value) {
- if (!isset($returnProperties[$value])) {
- $returnProperties[$value] = 1;
- }
- }
- }
-
- // get token details for contacts, call only if tokens are used
- $details = [];
- if (!empty($returnProperties) || !empty($tokens) || !empty($allTokens)) {
- list($details) = CRM_Utils_Token::getTokenDetails(
- $contactIds,
- $returnProperties,
- NULL, NULL, FALSE,
- $allTokens,
- 'CRM_Activity_BAO_Activity'
- );
- }
-
- $tokens = [];
- CRM_Utils_Hook::tokens($tokens);
- $categories = array_keys($tokens);
-
$escapeSmarty = FALSE;
if (defined('CIVICRM_MAIL_SMARTY') && CIVICRM_MAIL_SMARTY) {
$smarty = CRM_Core_Smarty::singleton();
$html = $contributionDetails[$contactId]['html'];
}
- if (!empty($details) && is_array($details["{$contactId}"])) {
- // unset email from details since it always returns primary email address
- unset($details["{$contactId}"]['email']);
- unset($details["{$contactId}"]['email_id']);
- $values = array_merge($values, $details["{$contactId}"]);
- }
-
$tokenSubject = $subject;
$tokenText = in_array($values['preferred_mail_format'], ['Both', 'Text'], TRUE) ? $text : '';
$tokenHtml = in_array($values['preferred_mail_format'], ['Both', 'HTML'], TRUE) ? $html : '';
'tokenContext' => $caseId ? ['caseId' => $caseId] : [],
'contactId' => $contactId,
'disableSmarty' => !CRM_Utils_Constant::value('CIVICRM_MAIL_SMARTY'),
- 'tplParams' => ['contact' => $values],
]);
$sent = FALSE;