Kopere Email

Notifications ::: message_kopereemail
Maintained by Eduardo Kraus
This plugin was developed to allow full customization of emails sent by Moodle, while maintaining a base template that standardizes the visual identity.
Latest release:
13 downloads
Current versions available: 1
Goal
Stop sending "ugly default Moodle emails" and gain a clean, branded, customizable email system.

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.

Email preview showing wrapper applied to a custom provider message

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.

Standardize identity
Apply a single wrapper to deliver consistent layout, spacing, branding, and links.
Custom messages per provider
Create "nice" tailored messages for key events (course completed, reminders, warnings).
Subject + body control
Override subject and HTML content in one place, centralized in admin.
Better inbox behavior
Digest mode for group conversations reduces spam and improves the experience.
Best part
Moodle keeps sending notifications as usual - the plugin intercepts delivery and applies your rules.

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.

Rule of thumb
  • If fullmessagehtml exists → apply wrapper.
  • If it doesn’t → create simple HTML from text, then apply wrapper (if configured).
Automatic configuration migration (on install)
To prevent students from receiving duplicate emails, the plugin can migrate settings to "take the place" of default email output.
  • Copies existing config from message/email into message_kopereemail.
  • Rewrites provider enabled flags from emailkopereemail.
  • Locks providers (*_locked = 1) to keep consistency.
  • Disables old email processor in mdl_message_processors.
Import / Export settings
Move wrapper + per-provider templates between environments (staging → production) or across sites.
  • 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.

Common
  • {{subject}}
  • {{fullmessage}}
  • {{{fullmessagehtml}}}
  • {{dates.now}}
Site
  • {{site.fullname}}
  • {{site.shortname}}
  • {{site.url}}
  • {{site.logourl}} / {{site.compact_logourl}}
Users to
  • {{userto.id}}
  • {{userto.profileurl}}
  • {{userto.fullname}}
  • {{userto.firstname}} / {{userto.lastname}}
  • {{userto.email}}
Users from
  • {{userfrom.id}}
  • {{userfrom.profileurl}}
  • {{userfrom.fullname}}
  • {{userfrom.firstname}} / {{userfrom.lastname}}
  • {{userfrom.email}}
Course (when detectable)
  • {{course.id}}
  • {{course.fullname}}
  • {{course.shortname}}
  • {{course.url}}
Suggested expansion (roadmap ideas)
If you want to expand the placeholder library, these are high-value additions that keep templates simple:
  • 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.
Template tip
Insert HTML with {{{variable}}} (triple braces). Using only {{variable}} may escape HTML and print tags as text.

Screenshots

Real UI views: wrapper editor, provider custom templates, and results.
Back to top
Custom message editor with subject, HTML editor, and available placeholders
Custom message per provider
Edit subject + HTML and use placeholders to generate a tailored message for that provider.
Wrapper template editor showing subject and fullmessagehtml placeholders
Wrapper template (base layout)
Define a global wrapper and inject the provider HTML via {{{fullmessagehtml}}}.
Admin list of providers with actions to create/edit/delete custom messages and export/import JSON
Providers table + Import/Export
Centralize management: create/edit/delete templates and migrate settings via JSON.
Email preview showing custom content rendered inside the wrapper
Final email result
The student receives a clean, branded email instead of Moodle’s default layout.
Testing workflow
Create/edit a template → save → use template preview/test email → adjust until perfect.

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.

Best practices
  • 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.
Why this approach works
  • No core modifications.
  • No theme hacks.
  • Centralized admin management.
  • Consistent branding across all emails.
  • Optional per-provider perfection.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4

Contributors

Eduardo Kraus (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments

덧글 보기
Please login to post comments