From 24f14405695e6043bf2718c4dcabc09651e5990d Mon Sep 17 00:00:00 2001 From: Eileen Date: Wed, 11 Dec 2013 08:32:12 +0000 Subject: [PATCH] CRM-13948 Hook alter mail params needs more info (id) --- CRM/Admin/Form/ScheduleReminders.php | 5 ++++- CRM/Core/BAO/ActionSchedule.php | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index ab33813b5f..f884c253e8 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -473,7 +473,10 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { $params['msg_template_id'] = CRM_Utils_Array::value('template', $values); } - CRM_Core_BAO_ActionSchedule::add($params, $ids); + $bao = CRM_Core_BAO_ActionSchedule::add($params); + // we need to set this on the form so that hooks can identify the created entity + $this->set('id', $bao->id); + $bao->free(); $status = ts("Your new Reminder titled %1 has been saved.", array(1 => "{$values['title']}") diff --git a/CRM/Core/BAO/ActionSchedule.php b/CRM/Core/BAO/ActionSchedule.php index f8f72ddd08..080e6451a3 100755 --- a/CRM/Core/BAO/ActionSchedule.php +++ b/CRM/Core/BAO/ActionSchedule.php @@ -463,6 +463,8 @@ WHERE cas.entity_value = $id AND 'toName' => $contact['display_name'], 'toEmail' => $email, 'subject' => $messageSubject, + 'entity' => 'action_schedule', + 'entity_id' => $scheduleID, ); if (!$html || $contact['preferred_mail_format'] == 'Text' || -- 2.25.1