CRM-13948
authorEileen <eileen@fuzion.co.nz>
Wed, 11 Dec 2013 08:32:12 +0000 (08:32 +0000)
committerEileen <eileen@fuzion.co.nz>
Wed, 11 Dec 2013 08:35:58 +0000 (21:35 +1300)
Hook alter mail params needs more info (id)

CRM/Admin/Form/ScheduleReminders.php
CRM/Core/BAO/ActionSchedule.php

index ab33813b5f2c2707fb8e432157d2c852cc608f56..f884c253e85b04461e6eb9ffc76f981620bc5d03 100644 (file)
@@ -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 => "<strong>{$values['title']}</strong>")
index f8f72ddd085bcb70ae7497e895dc064c134e1fd4..080e6451a336226a99584d16246aeb199328f3a6 100755 (executable)
@@ -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' ||