message_service
class message_service implements message_service_interface
| internal |
Message Service.
Facade for Moodle's messaging and email subsystems with token replacement support.
Constants
| COMPONENT |
|
| NAME |
|
Methods
void
email(mixed $from, mixed $to, string $subject, string $text, int $courseid = 0, array|null $attachments = null)
Send an email message using Moodle's messaging subsystem.
mixed
message(mixed $from, mixed $to, string $subject, string $text, int $courseid = 0)
Send an in-app message.
mixed
notification(mixed $from, mixed $to, string $subject, string $text, int $courseid = 0, mixed $url = null, string|null $urlname = null)
Send a notification (non-reply) message.
mixed
prepare(mixed $from, mixed $to, string $subject, string $text, int $courseid = 0)
Prepare a core message payload.
int
get_conversation_id(mixed $message)
Retrieve the conversation identifier for a prepared message.
array
prepare_text(mixed $course, mixed $user)
Build placeholder replacements for user/course context.
Details
at line 61
void
email(mixed $from, mixed $to, string $subject, string $text, int $courseid = 0, array|null $attachments = null)
Send an email message using Moodle's messaging subsystem.
at line 103
mixed
message(mixed $from, mixed $to, string $subject, string $text, int $courseid = 0)
Send an in-app message.
at line 139
mixed
notification(mixed $from, mixed $to, string $subject, string $text, int $courseid = 0, mixed $url = null, string|null $urlname = null)
Send a notification (non-reply) message.
at line 182
mixed
prepare(mixed $from, mixed $to, string $subject, string $text, int $courseid = 0)
Prepare a core message payload.
at line 210
int
get_conversation_id(mixed $message)
Retrieve the conversation identifier for a prepared message.
at line 225
array
prepare_text(mixed $course, mixed $user)
Build placeholder replacements for user/course context.