From: chanzone Date: Fri, 26 Feb 2016 14:05:26 +0000 (+0800) Subject: CRM-16722 - Fixed token fails in event registration email X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a7c6483019d7ee298735cf010b845057be1d0cb5;p=civicrm-core.git CRM-16722 - Fixed token fails in event registration email --- diff --git a/CRM/Core/BAO/MessageTemplate.php b/CRM/Core/BAO/MessageTemplate.php index ee6b7a9c99..3f6e7a7114 100644 --- a/CRM/Core/BAO/MessageTemplate.php +++ b/CRM/Core/BAO/MessageTemplate.php @@ -405,6 +405,7 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { $domain = CRM_Core_BAO_Domain::getDomain(); $hookTokens = array(); $mailing = new CRM_Mailing_BAO_Mailing(); + $mailing->subject = $subject; $mailing->body_text = $text; $mailing->body_html = $html; $tokens = $mailing->getTokens(); @@ -417,6 +418,12 @@ class CRM_Core_BAO_MessageTemplate extends CRM_Core_DAO_MessageTemplate { $contactParams = array('contact_id' => $contactID); $returnProperties = array(); + if (isset($tokens['subject']['contact'])) { + foreach ($tokens['subject']['contact'] as $name) { + $returnProperties[$name] = 1; + } + } + if (isset($tokens['text']['contact'])) { foreach ($tokens['text']['contact'] as $name) { $returnProperties[$name] = 1;