2 // This file is part of Moodle - http://moodle.org/
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 * Defines message providers (types of messages being sent)
20 * The providers defined on this file are processed and registered into
21 * the Moodle DB after any install or upgrade operation. All plugins
24 * For more information, take a look to the documentation available:
25 * - Message API: {@link http://docs.moodle.org/dev/Message_API}
26 * - Upgrade API: {@link https://moodledev.io/docs/guides/upgrade}
30 * @copyright 2008 onwards Martin Dougiamas http://dougiamas.com
31 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 defined('MOODLE_INTERNAL') ||
die();
36 $messageproviders = array (
40 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
41 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
42 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
46 // Notices that an admin might be interested in.
49 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
50 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
52 'capability' => 'moodle/site:config',
55 // Important errors that an admin ought to know about.
58 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
59 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
61 'capability' => 'moodle/site:config',
64 // Cron-based notifications about available moodle and/or additional plugin updates.
65 'availableupdate' => array(
67 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
68 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
70 'capability' => 'moodle/site:config',
73 'instantmessage' => array (
75 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
76 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
82 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
83 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
85 'capability' => 'moodle/site:config'
88 // Course creation request notification
89 'courserequested' => array (
91 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
92 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
94 'capability' => 'moodle/site:approvecourse'
97 // Course request approval notification.
98 'courserequestapproved' => array (
99 'capability' => 'moodle/course:request',
101 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
102 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
103 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
107 // Course request rejection notification.
108 'courserequestrejected' => array (
109 'capability' => 'moodle/course:request',
111 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
112 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
113 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
117 // Course completed. Requires course completion configured at course level. It does not work with just activity progress.
118 'coursecompleted' => [
120 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
121 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
122 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
126 // Course content updated. New content (activities or resources) has been created or existing content updated.
127 'coursecontentupdated' => array (
129 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
130 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
131 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
135 // Badge award notification to a badge recipient.
136 'badgerecipientnotice' => array (
138 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
139 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
140 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
142 'capability' => 'moodle/badges:earnbadge'
145 // Badge award notification to a badge creator (mostly cron-based).
146 'badgecreatornotice' => array (
148 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
149 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
153 // A comment was left on a plan.
154 'competencyplancomment' => [
156 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
157 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
161 // A comment was left on a user competency.
162 'competencyusercompcomment' => [
164 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
165 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
170 'insights' => array (
172 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
173 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
174 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
178 // Message contact requests.
179 'messagecontactrequests' => [
181 // We don't need to notify in the popup output here because the message drawer
182 // already notifies users of contact requests.
183 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
184 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
188 // Asyncronhous backup/restore notifications.
189 'asyncbackupnotification' => array(
191 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
192 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
196 'gradenotifications' => [
198 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
199 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
206 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
207 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
209 'capability' => 'moodle/site:config',
212 // Report builder schedules.
213 'reportbuilderschedule' => [
215 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED
,
216 'email' => MESSAGE_FORCED
,