From 4c2eade7723ce133dd6d9e865670b385d5633c9d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 16 Sep 2021 10:48:07 +1200 Subject: [PATCH] Remove code to assign contact to the template in sendEmail --- CRM/Activity/BAO/Activity.php | 39 ----------------------------------- 1 file changed, 39 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 6215dbcc2a95..f18c933ae286 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -1056,37 +1056,6 @@ public static function sendEmail( $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(); @@ -1120,13 +1089,6 @@ public static function sendEmail( $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 : ''; @@ -1140,7 +1102,6 @@ public static function sendEmail( 'tokenContext' => $caseId ? ['caseId' => $caseId] : [], 'contactId' => $contactId, 'disableSmarty' => !CRM_Utils_Constant::value('CIVICRM_MAIL_SMARTY'), - 'tplParams' => ['contact' => $values], ]); $sent = FALSE;