From 3417627c8cc96baf470f26cfd62076b80c4f70dd Mon Sep 17 00:00:00 2001 From: "deb.monish" Date: Sun, 16 Jul 2017 17:00:31 +0530 Subject: [PATCH] CRM-20845: create alterMailingRecipients hook --- CRM/Utils/Hook.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CRM/Utils/Hook.php b/CRM/Utils/Hook.php index 1f75b3ab8d..caef0b11d0 100644 --- a/CRM/Utils/Hook.php +++ b/CRM/Utils/Hook.php @@ -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' + ); + } + } -- 2.25.1