MDL-47162 core_message: Updating all uses of messaging to add courseid

This commit is contained in:
Eric Merrill
2016-10-31 14:13:13 -04:00
parent a29bcf7819
commit 880fc15bf0
18 changed files with 41 additions and 10 deletions
@@ -84,6 +84,7 @@ class notification_task extends \core\task\adhoc_task {
$template = $this->replace_placeholders($template, $subscription, $eventobj, $context);
$htmlmessage = format_text($template, $subscription->templateformat, array('context' => $context));
$msgdata = new \core\message\message();
$msgdata->courseid = empty($subscription->courseid) ? SITEID : $subscription->courseid;
$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();