Email and notifications
When mail is sent
Mail is sent only when send_email is enabled in Configuration. Implemented via hook_mail() and entity insert/update hooks.
| Event | Mail key | Recipients |
|---|---|---|
| Note created | insert |
Collected from note owner, assignee, entity owner, revision author, parent thread participants (see below). |
| Note assigned (new or changed) | assign |
Assignee. |
| Note resolved (published → unpublished) | resolve |
Same as insert. |
| Note re-opened (unpublished → published) | re-open |
Same as insert. |
No mail is sent on note delete (resolve notification was already sent).
Recipients (insert / resolve / re-open)
_moderation_note_collect_recipients() in moderation_note.module gathers:
- Note owner
- Note assignee
- Notated entity owner (if
EntityOwnerInterface) - Revision author (if
RevisionLogInterface) - Parent note owner
- All children’s owners and assignees
Only active users with view access on the note are included; duplicates are removed.
Customization
- Disable: Set “Send email notifications” to off at
/admin/config/moderation-note(see Configuration). - Override body: Override template
mail-moderation-note.html.twigin your theme. - Mail plugin: Backend is
moderation_note(classDrupal\moderation_note\Plugin\Mail\NoteMail). Subject and body are built inmoderation_note_mail().