Merge branch 'MDL-79938-main' of https://github.com/sammarshallou/moodle
[moodle.git] / lib / db / messages.php
blob56b67ecd63040c400fe202438b4795884033e4aa
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
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.
8 //
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/>.
17 /**
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
22 * support this.
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}
28 * @package core
29 * @category message
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 (
38 'newlogin' => array (
39 'defaults' => [
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.
47 'notices' => array (
48 'defaults' => [
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.
56 'errors' => array (
57 'defaults' => [
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(
66 'defaults' => [
67 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
68 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
70 'capability' => 'moodle/site:config',
73 'instantmessage' => array (
74 'defaults' => array(
75 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
76 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
80 'backup' => array (
81 'defaults' => [
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 (
90 'defaults' => [
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',
100 'defaults' => [
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',
110 'defaults' => [
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' => [
119 'defaults' => [
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 (
128 'defaults' => 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 (
137 'defaults' => 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 (
147 'defaults' => [
148 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
149 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
153 // A comment was left on a plan.
154 'competencyplancomment' => [
155 'defaults' => [
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' => [
163 'defaults' => [
164 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
165 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
169 // User insights.
170 'insights' => array (
171 'defaults' => [
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' => [
180 'defaults' => [
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(
190 'defaults' => array(
191 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
192 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
196 'gradenotifications' => [
197 'defaults' => array(
198 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
199 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
203 // Infected files.
204 'infected' => array(
205 'defaults' => [
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' => [
214 'defaults' => [
215 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
216 'email' => MESSAGE_FORCED,