CRM-20845: create alterMailingRecipients hook
authordeb.monish <monish.deb@jmaconsulting.biz>
Sun, 16 Jul 2017 11:30:31 +0000 (17:00 +0530)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Tue, 19 Jun 2018 07:44:00 +0000 (13:14 +0530)
CRM/Utils/Hook.php

index 1f75b3ab8dade666643fc291f0747713462d4338..caef0b11d0dc9ac947ef3e5285535f6b3e29efcc 100644 (file)
@@ -2450,4 +2450,23 @@ abstract class CRM_Utils_Hook {
     );
   }
 
+  /**
+   * This hook is called before and after constructing mail recipients.
+   *  Allows user to alter filter and/or search query to fetch mail recipients
+   *
+   * @param CRM_Mailing_DAO_Mailing $mailingObject
+   * @param CRM_Mailing_Event_BAO_Queue $mailingEventQueueObject
+   * @param int $mailingJobID
+   * @param array $params
+   * @param string $context
+   *
+   */
+  public static function alterMailingRecipients(&$mailingObject, &$mailingEventQueueObject, $mailingJobID, &$params, $context) {
+    return self::singleton()->invoke(array('mailingObject', 'mailingEventQueueObject', '$mailingJobID', 'params', 'context'),
+      $mailingObject, $mailingEventQueueObject, $mailingJobID, $params, $context,
+      self::$_nullObject,
+      'civicrm_alterMailingRecipients'
+    );
+  }
+
 }