From: deb.monish Date: Sun, 16 Jul 2017 11:30:31 +0000 (+0530) Subject: CRM-20845: create alterMailingRecipients hook X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3417627c8cc96baf470f26cfd62076b80c4f70dd;p=civicrm-core.git CRM-20845: create alterMailingRecipients hook --- 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' + ); + } + }