From 532e83d36cf03f60e5683d5eb0342ab05d0193a5 Mon Sep 17 00:00:00 2001 From: mountev <33451769+mountev@users.noreply.github.com> Date: Wed, 6 Dec 2017 19:38:15 +0000 Subject: [PATCH] CRM-21494 trigger pre hook on mailing bounce (#11353) * create mailing bounce hook * CRM-21494 create-edit action and post-hook * CRM-21494 - pre hook 3rd arg --- CRM/Mailing/Event/BAO/Bounce.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CRM/Mailing/Event/BAO/Bounce.php b/CRM/Mailing/Event/BAO/Bounce.php index ae9944f0b9..ac5d8735e3 100644 --- a/CRM/Mailing/Event/BAO/Bounce.php +++ b/CRM/Mailing/Event/BAO/Bounce.php @@ -61,6 +61,9 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce { $bounce = new CRM_Mailing_Event_BAO_Bounce(); $bounce->time_stamp = date('YmdHis'); + $action = empty($params['id']) ? 'create' : 'edit'; + CRM_Utils_Hook::pre($action, 'MailingEventBounce', CRM_Utils_Array::value('id', $params), $params); + // if we dont have a valid bounce type, we should set it // to bounce_type_id 11 which is Syntax error. this allows such email // addresses to be bounce a few more time before being put on hold @@ -80,6 +83,8 @@ class CRM_Mailing_Event_BAO_Bounce extends CRM_Mailing_Event_DAO_Bounce { $bounce->copyValues($params); $bounce->save(); + CRM_Utils_Hook::post($action, 'MailingEventBounce', $bounce->id, $bounce); + if ($q->email_id) { self::putEmailOnHold($q->email_id); } -- 2.25.1