message_service_interface
interface message_service_interface
Public contract for the message_service facade.
Extensions depend ONLY on this interface — never on the core implementation. No Moodle/Core dependencies are allowed inside this contract.
Methods
void
email(mixed $from, mixed $to, string $subject, string $text, int $courseid = SITEID, array|null $attachments = null)
Send an email message.
mixed
message(mixed $from, mixed $to, string $subject, string $text, int $courseid = SITEID)
Send a Moodle message (non-notification).
mixed
notification(mixed $from, mixed $to, string $subject, string $text, int $courseid = SITEID, mixed $url = null, string|null $urlname = null)
Send a Moodle notification.
mixed
prepare(mixed $from, mixed $to, string $subject, string $text, int $courseid = SITEID)
Prepare a structured message object.
int
get_conversation_id(mixed $message)
Get or create a conversation ID for a message.
array
prepare_text(mixed $course, mixed $user)
Replace template variables in a message.
Details
at line 38
void
email(mixed $from, mixed $to, string $subject, string $text, int $courseid = SITEID, array|null $attachments = null)
Send an email message.
at line 58
mixed
message(mixed $from, mixed $to, string $subject, string $text, int $courseid = SITEID)
Send a Moodle message (non-notification).
at line 79
mixed
notification(mixed $from, mixed $to, string $subject, string $text, int $courseid = SITEID, mixed $url = null, string|null $urlname = null)
Send a Moodle notification.
at line 100
mixed
prepare(mixed $from, mixed $to, string $subject, string $text, int $courseid = SITEID)
Prepare a structured message object.
at line 115
int
get_conversation_id(mixed $message)
Get or create a conversation ID for a message.
at line 125
array
prepare_text(mixed $course, mixed $user)
Replace template variables in a message.