Skip to content

Notices and placeholders

The five notices

Five texts, one per notice, existing from installation. There is nothing to create and nothing to delete: only the wording to edit, the recipient to choose, and a switch on each certification saying whether it sends that notice.

NoticeSent becauseWhen it goes out
Enrolment noticeSomebody is enrolled on a course belonging to the certificationImmediately, or after the delay set on the notice
Completion noticeSomebody completes an edition and a certificate is issuedImmediately, or after the delay set on the notice
Expiry warningA certificate is approaching its expiryOn each day in the certification's Expiry warnings (days before) list
Overdue reminderA completion deadline has passed with no completionOn each day in the certification's Overdue reminders (days after) list
Expiry noticeA certificate has passed its expiryOn each day in the certification's Expired reminders (days after) list

The delay on the notice applies to the enrolment and completion notices only, and cannot be negative. On the other three it is not shown, because how much notice an obligation gives is set on each certification as a list like 60,30,7 — one email per value.

An enrolment whose start date is in the future queues its notice for the day the enrolment window opens, rather than sending it while nobody can enter the course.

Statuses and notices are separate

The certification's Expiry warnings (days before) list decides when an email is queued. Its Certification expiration warning (days) decides when a status becomes Expiring. Neither reads the other, and nothing forces them to match — the certification form says so when they differ.

Two consequences:

  • An expiry warning is chosen by date, not by status. It selects the people whose expiration date falls on the day the offset points at, whatever their status is.
  • An expiry notice is chosen from the certificate, not from the live row. By the time an expiry notice with an offset of two days goes out, the person's row has usually left the User status page. The notice is selected from the certificate in the history instead, which is why it reaches them at all, and why resending one works.

The expiry notice skips anybody who is covered by another certificate today, because they have renewed.

An expiry warning is not delivered after the expiry

If a warning could not be sent before the date it announces — a lapsed licence, cron stopped, a queue full for a day — it is discarded rather than sent late, with the reason written to the cron output. "Your certificate expires in 30 days" stops being true the moment it expires.

The other four notices are never discarded. The overdue notice and the expiry notice already refer to a date in the past, so arriving late does not make them wrong.

Recipients

ValueGoes to
UserThe person concerned
ManagerThe certification's Manager emails; failing that, the site-wide Fallback manager emails

The addresses are configuration, not Moodle accounts: LOOP does not read any manager relationship from Moodle, and a notice addressed to the Manager goes to the same addresses for everybody covered by that certification.

With neither set, the notice is discarded and the certification is flagged twice on Manage certifications: a Manager notice badge in the Warnings column, and Won't send in that notice's own column.

Placeholders

Usable in both the subject and the body. Anything with no value at send time is replaced with nothing.

PlaceholderReplaced with
{username}The recipient's Moodle username
{firstname}First name
{lastname}Surname
{certificationname}The certification's name
{coursename}Full name of the course in context — see below
{courseurl}Direct link to that course
{expirydate}The expiration date, formatted for the recipient
{duedate}The completion due date, same formatting

Which course {coursename} names

The enrolment and completion notices name the course that produced them: that specific course is what the email is about.

The three reminders — expiry warning, overdue, expiry notice — choose theirs when the mail is sent: the edition the person is currently enrolled on, and nothing at all when they are enrolled on none. Empty is an answer: nobody has enrolled them yet, and the reminder says the certificate is running out, not which course to take next.

Because the choice is made at send time, a resend names the course that is right today rather than the one recorded when the original went out.

Language fallback

At send time LOOP picks the translation matching the recipient's Moodle language preference, then walks this chain until it finds text:

  1. the exact language;
  2. its parent language (en_usen);
  3. the site's default language;
  4. that language's parent;
  5. English.

English is always the last candidate, because only the English text ships with the plugin. This is why removing the English text, or the text for the site's default language, is refused.

Calendar attachment

The enrolment notice and the expiry warning can attach an .ics calendar entry, so the deadline lands in the recipient's calendar as well as their inbox.