From: yashodha Date: Fri, 20 Nov 2015 06:02:34 +0000 (+0530) Subject: CRM-15306: Adding hook to alter mail templates X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d1719f828e75c8c28da43487174969737c5ecabf;p=civicrm-core.git CRM-15306: Adding hook to alter mail templates ---------------------------------------- * CRM-15306: Adding hook to alter mail templates https://issues.civicrm.org/jira/browse/CRM-15306 --- diff --git a/CRM/Mailing/BAO/Mailing.php b/CRM/Mailing/BAO/Mailing.php index 4b36fc453b..48d8dbbaeb 100644 --- a/CRM/Mailing/BAO/Mailing.php +++ b/CRM/Mailing/BAO/Mailing.php @@ -803,7 +803,7 @@ ORDER BY i.contact_id, i.{$tempColumn} $this->templates['subject'] = implode("\n", $template); } - CRM_Utils_Hook::alterMailTemplates($this->templates); + CRM_Utils_Hook::alterMailContent($this->templates); } return $this->templates; } diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index af9744cb55..242a7b4d37 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -1001,15 +1001,15 @@ abstract class CRM_Utils_Hook { /** * This hook is called after getting the content of the mail and before tokenizing it. * - * @param array $templates + * @param array $content * Array fields include: html, text, subject * * @return mixed */ - public static function alterMailTemplates(&$templates) { - return self::singleton()->invoke(1, $templates, + public static function alterMailContent(&$content) { + return self::singleton()->invoke(1, $content, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, self::$_nullObject, - 'civicrm_alterMailTemplates' + 'civicrm_alterMailContent' ); }