Summary

Establish a shared convention across this module family (pdv, audit_trail, webdav, and their bridges) for notification-worthy events, so no module reimplements its own notification mechanism. The principle: a module owns what happened and dispatches a well-named event; how to notify (channels, templates, per-user preferences, throttling) is the site job, handled once by a shared delivery layer.

Why

Drupal core has no single notification API, so the path of least resistance is for each module to hand-roll hook_mail plus token replacement, and every module rebuilds the same delivery and preferences plumbing. That duplication is what this convention avoids: consolidate the shared behavior in one consumer rather than copying it across modules.

The convention

  • A module dispatches a domain event for each notification-worthy moment, named consistently (for example pdv vault.dormancy_warning_due, audit_trail chain_verification_failed), carrying a stable documented payload (subject, context ids, severity, a render-safe summary) and no PII beyond what a downstream handler needs.
  • A module does not deliver notifications itself: no bespoke hook_mail notifier, no per-module channel or preference handling.
  • Delivery is configured once at the site level against those events. The recommended mechanism is ECA (event-driven, no-code: map an event to a channel and template), with the Message stack or Courier as alternatives when stored messages or per-user channel preferences are wanted. Symfony Mailer is the templated email layer underneath.
  • A module may ship a minimal default (a plain email via the mail manager) so it works out of the box, but that default is overridable and never a second delivery framework.

Scope

Applies to pdv (and pdv_client and the audit bridges), audit_trail (and audit_trail_webdav and audit_trail_tsa), and webdav. Concrete consumers already on the table: the dormant-vault warnings and the "your export is ready" message from the owner vault export.

Deliverables

  • A short documented event-naming and payload convention.
  • An audit of where each module currently sends or would send notifications, and a plan to route them through events.
  • Optionally, example ECA models (event to email) shipped as documentation, not as a dependency.

Open questions

  • Where the convention is documented (a shared page versus per-module docs).
  • Whether to provide a tiny shared event base or interface, or keep each module independent and align by convention only (leaning toward convention only, to avoid a shared dependency).

Issue fork pdv-3593604

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

  • mably committed 6fd62126 on 1.x
    task: #3593604 drop the Notification convention roadmap item
    
    By: mably
    
mably’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mably’s picture

Status: Fixed » Closed (fixed)