Moodle Plugins directory: Kopere Email | Moodle.org
Kopere Email
Kopere Email
message_kopereemail is a Moodle message output based on message_email, built to deliver consistent, branded emails - while still letting you create fully custom HTML per notification type.

What the plugin solves (in practice)
Moodle can send many different notifications, from many plugin. This plugin adds the missing layer: control, consistency, and customization without core changes or theme hacks.
How it works
The plugin adds a customization layer on top of Moodle’s existing messaging flow. It decides what to send based on provider and available HTML, then standardizes the final output with the wrapper.
- If
fullmessagehtmlexists → apply wrapper. - If it doesn’t → create simple HTML from text, then apply wrapper (if configured).
- Copies existing config from
message/emailintomessage_kopereemail. - Rewrites provider enabled flags from
email→kopereemail. - Locks providers (
*_locked = 1) to keep consistency. - Disables old email processor in
mdl_message_processors.
- Exports global wrapper.
- Exports custom messages per provider (component + name).
- Does not overwrite Moodle operational preferences like enabled/locked flags.
Available placeholders
Templates use Mustache-style placeholders. Use triple braces when inserting HTML.
{{subject}}{{fullmessage}}{{{fullmessagehtml}}}{{dates.now}}
{{site.fullname}}{{site.shortname}}{{site.url}}{{site.logourl}}/{{site.compact_logourl}}
{{userto.id}}{{userto.profileurl}}{{userto.fullname}}{{userto.firstname}}/{{userto.lastname}}{{userto.email}}
{{userfrom.id}}{{userfrom.profileurl}}{{userfrom.fullname}}{{userfrom.firstname}}/{{userfrom.lastname}}{{userfrom.email}}
{{course.id}}{{course.fullname}}{{course.shortname}}{{course.url}}
- Course completion details: completion date, grade, certificate URL, time spent.
- Course metadata: category name, start/end date, visibility, custom fields.
- Recipient convenience: preferred language, timezone, profile fields (safe subset).
- Sender context: role name in course, department/campus (if available).
- Utility formatting: preformatted dates, safe links, "short excerpt" from long messages.
- CTA links: "Go to course", "Open activity", "Message preferences" URLs as ready-to-use placeholders.
{{{variable}}} (triple braces). Using only {{variable}} may escape HTML and print tags as text.Screenshots
{{{fullmessagehtml}}}.
Support
For questions, bugs, improvements, or suggestions, open an issue with: Moodle version, steps to reproduce, affected provider (component + name), and template example (without sensitive data). If it’s about digest, include cron/task logs.
- Start with the wrapper: set the global identity first.
- Customize only the providers that matter.
- Keep templates objective and scannable.
- Validate HTML structure (close tags properly).
- Always test after saving.
- No core modifications.
- No theme hacks.
- Centralized admin management.
- Consistent branding across all emails.
- Optional per-provider perfection.
Comments