CRM-15306: Adding hook to alter mail templates
authoryashodha <yashodha.chaku@webaccessglobal.com>
Fri, 20 Nov 2015 06:02:34 +0000 (11:32 +0530)
committeryashodha <yashodha.chaku@webaccessglobal.com>
Fri, 20 Nov 2015 06:02:34 +0000 (11:32 +0530)
----------------------------------------
* CRM-15306: Adding hook to alter mail templates
  https://issues.civicrm.org/jira/browse/CRM-15306

CRM/Mailing/BAO/Mailing.php
CRM/Utils/Hook.php

index 4b36fc453b9d4aaa173e922b6e7184fd8231c2fb..48d8dbbaeb00456aa76c74fcbca7c87e3bcc4d58 100644 (file)
@@ -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;
   }
index af9744cb55a64955840aa23539a61e6cfa992fbb..242a7b4d378b0f3b81b6ee396ae5cb598616e5be 100644 (file)
@@ -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'
     );
   }