Expand description
Per-user opt-in subscriptions to page publish events.
Editors / stakeholders subscribe to pages they care about and
receive an email when the page transitions into Published. Fires
from the same three publish paths the after_publish_page hook
does (single page edit, bulk publish, workflow auto-publish).
Notification delivery is best-effort and depends on the host
having wired a mailer via router_with_mailer / with_mailer_from.
Hosts that haven’t wired one log a debug line and skip — no
invariants broken.
Structs§
Functions§
- is_
subscribed - Whether
user_idhas an active subscription onpage_id. - notify_
pre_ publish - Fan out a pre-publish reminder. Called from the schedule
sweep when a page’s
go_live_atis within the next hour. Same muting + actor-skip semantics asnotify_publish. - notify_
publish - Fan out a publish notification to every subscriber of
page_id. Best-effort — if the mailer is missing or any send fails, the publish itself is unaffected. - render_
pre_ publish_ notification - Compose the subject + body for the pre-publish reminder.
Mirrors
render_publish_notificationbut flags that the publish hasn’t happened yet so subscribers can intervene. - render_
publish_ notification - Compose the publish-notification subject + body for one page.
- subscribe
- Subscribe
user_idto publish events forpage_id. Idempotent — re-subscribing does not insert a duplicate row. - subscribers_
for_ page - Every subscriber of
page_id. Used by the notification fan-out when a page publishes. - unsubscribe
- Remove
user_id’s subscription onpage_id. No-op when no row exists. Returns the number of rows deleted (0 or 1).