MDL-47162 core_message: Add course id to message eventdata

This commit is contained in:
Amanda Doughty 2016-07-20 12:40:34 +01:00 committed by Eloy Lafuente (stronk7)
parent 577bd70d38
commit cc350fd9c8
34 changed files with 345 additions and 76 deletions

View file

@ -920,7 +920,7 @@ class manager {
$addressmanager->set_handler('\tool_messageinbound\message\inbound\invalid_recipient_handler');
$addressmanager->set_data($record->id);
$eventdata = new \stdClass();
$eventdata = new \core\message\message();
$eventdata->component = 'tool_messageinbound';
$eventdata->name = 'invalidrecipienthandler';
@ -970,7 +970,7 @@ class manager {
$messagedata->subject = $this->currentmessagedata->envelope->subject;
$messagedata->error = $error;
$eventdata = new \stdClass();
$eventdata = new \core\message\message();
$eventdata->component = 'tool_messageinbound';
$eventdata->name = 'messageprocessingerror';
$eventdata->userfrom = $userfrom;
@ -1029,7 +1029,7 @@ class manager {
$messagedata = new \stdClass();
$messagedata->subject = $this->currentmessagedata->envelope->subject;
$eventdata = new \stdClass();
$eventdata = new \core\message\message();
$eventdata->component = 'tool_messageinbound';
$eventdata->name = 'messageprocessingsuccess';
$eventdata->userfrom = $userfrom;

View file

@ -83,7 +83,7 @@ class notification_task extends \core\task\adhoc_task {
$template = $subscription->template;
$template = $this->replace_placeholders($template, $subscription, $eventobj, $context);
$htmlmessage = format_text($template, $subscription->templateformat, array('context' => $context));
$msgdata = new \stdClass();
$msgdata = new \core\message\message();
$msgdata->component = 'tool_monitor'; // Your component name.
$msgdata->name = 'notification'; // This is the message name from messages.php.
$msgdata->userfrom = \core_user::get_noreply_user();