From c7436e9ce753bf627c6733b78cb6c02c64c84f84 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Mon, 20 Jan 2014 17:00:43 -0800 Subject: [PATCH] CRM-14095 - Fix bug where email token hook not called if no core tokens present --- CRM/Activity/BAO/Activity.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 684fc06bfc..c8f890f838 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -1177,6 +1177,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND $subjectToken = CRM_Utils_Token::getTokens($subject); $messageToken = CRM_Utils_Token::getTokens($text); $messageToken = array_merge($messageToken, CRM_Utils_Token::getTokens($html)); + $allTokens = array_merge($messageToken, $subjectToken); if (!$from) { $from = "$fromDisplayName <$fromEmail>"; @@ -1242,12 +1243,12 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND // get token details for contacts, call only if tokens are used $details = array(); - if (!empty($returnProperties)) { + if (!empty($allTokens)) { list($details) = CRM_Utils_Token::getTokenDetails( $contactIds, $returnProperties, NULL, NULL, FALSE, - $messageToken, + $allTokens, 'CRM_Activity_BAO_Activity' ); } -- 2.25.1