Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Message API

From MoodleDocs
Revision as of 04:20, 12 January 2012 by Andrew Davis (talk | contribs) (Created page with "TODO: delete https://docs.moodle.org/dev/Messaging, this document replaces it. ==What is this thing?== This document describes how to make use of the Moodle messaging API to sen...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

TODO: delete https://docs.moodle.org/dev/Messaging, this document replaces it.

What is this thing?

This document describes how to make use of the Moodle messaging API to send message to Moodle users.

If you are after a general introduction on using the Moodle messaging system go to https://docs.moodle.org/en/Messaging

If you are looking for implementation details of the messaging system's internal structure go to https://docs.moodle.org/dev/Messaging_2.0

If you are looking for instructions on the implementation of a custom message processor go to https://github.com/andyjdavis/moodle-custom-message-processor

If you are looking for instructions on sending messages programatically within Moodle then read on...

Overview

Moodle components have the ability to send message to users via the Moodle messaging system. Any type of component, for example a plugin or block, can register as a message producer.

File locations

The Message API is all in lib/messagelib.php and is automatically included for you during the page setup.

Functions

message_send() is the primary point of contact for the message API. Call it to send a message to a user. You can find a full description of the arguments that must be supplied at (link to phpdocs)

Examples

How to register as a message producer

How to send a message