Moodle provides an instant messaging type of communication that allows you to send messages to any Moodle user. If a user is online when a message is sent, they will receive it in their message box and can view it in a pop-up window. If the user is not online within a configured timeframe, the message will be sent to them via e-mail.
This mechanism can therefore be a more effective communication tool than just e-mail. It can alert a user in the Moodle environment and fall back to e-mail.
Let's complete our entry_notification_messaging
function to use Moodle messaging.
Moodle messaging uses two data tables to handle message delivery: message
and message_read
. When a message is sent to a user, it is inserted into the message
table. Its existence indicates an unread message to that user, and will trigger the message indicators when that user is online. Once the user has viewed that message, the record is moved to the message_read
table. This...