Note:

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

Message API: Difference between revisions

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


==What is this thing?==
==What is this document?==


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

Revision as of 04:23, 12 January 2012

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

What is this document?

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 (a component that receives messages sent to a user) 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 then send messages to users.

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