|
| get_fullmessage ($processorname='') |
| Fullmessage content including any processor specific content.
|
|
| get_fullmessagehtml ($processorname='') |
| Fullmessagehtml content including any processor specific content.
|
|
| get_message_with_additional_content ($processorname, $messagetype) |
| Helper method used to get message content added with processor specific content.
|
|
| get_smallmessage ($processorname='') |
| Smallmessage content including any processor specific content.
|
|
| set_customdata ($customdata) |
| Always JSON encode customdata.
|
|
New messaging class.
Required parameters of the $eventdata object: component string Component name. must exist in message_providers name string Message type name. must exist in message_providers userfrom object|int The user sending the message userto object|int The message recipient. This is mandatory for NOTIFICACIONS and 1:1 personal messages. subject string The message subject fullmessage string The full message in a given format fullmessageformat int The format if the full message (FORMAT_MOODLE, FORMAT_HTML, ..) fullmessagehtml string The full version (the message processor will choose with one to use) smallmessage string The small version of the message
Required parameters of the $eventdata object for PERSONAL MESSAGES: convid int The conversation identifier where this message will be sent
Optional parameters of the $eventdata object: notification bool Should the message be considered as a notification rather than a personal message contexturl string If this is a notification then you can specify a url to view the event. For example the forum post the user is being notified of. contexturlname string The display text for contexturl. replyto string An email address which can be used to send an reply. attachment stored_file File instance that needs to be sent as attachment. attachname string Name of the attachment. customdata mixed Custom data to be passed to the message processor. Must be serialisable using json_encode().
- Since
- Moodle 2.9
- Copyright
- 2015 onwards Ankit Agarwal
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
core\message\message::set_additional_content |
( |
| $processorname, |
|
|
| $content ) |
This method lets you define content that would be added to the message only for specific message processors.
Example of $content:- array('fullmessagehtml' => array('header' => 'header content', 'footer' => 'footer content'), 'smallmessage' => array('header' => 'header content for small message', 'footer' => 'footer content'), '*' => array('header' => 'header content for all types', 'footer' => 'footer content') )
- Parameters
-
string | $processorname | name of the processor. |
array | $content | content to add in the above defined format. |