Skip to content

Deliver subscription notifications through the phpBB notification system - #457

Open
ECYaz wants to merge 4 commits into
phpbb:3.3.xfrom
ECYaz:feature/452-notifications
Open

Deliver subscription notifications through the phpBB notification system#457
ECYaz wants to merge 4 commits into
phpbb:3.3.xfrom
ECYaz:feature/452-notifications

Conversation

@ECYaz

@ECYaz ECYaz commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Titania subscriptions only send email through the legacy messenger. Nothing reaches the notification bell or the UCP notification options (#452). Validation status changes are also invisible to authors (#450).

Commit 1 routes all subscription events through the phpBB notification system:

  • Five types under a Customisation Database group in the UCP notification options: posted, contribution, queue, queue_move, attention
  • Same events and same recipients as the emails today, converted one for one
  • The watch table, subscribe links and automatic author subscriptions are unchanged
  • Existing email templates are reused, so the mails look exactly as before
  • A migration seeds email on for every current watcher, and registration seeds it for new users, so nobody loses email; everyone gains the bell and full UCP control
  • Also fixed along the way: dispatches that ran before their rows existed, and stale notifications now removed when their post, revision, queue item or contribution is deleted

Commit 2 adds the status updates from #450, following the direction given there:

  • When a validator moves a queue item, the robot posts to the validation discussion topic, for example: The status of this submission has been changed to: Validating
  • Authors see that topic and are subscribed by default, so the post reaches them as a bell notification and email through the posted type
  • Falls back to the validator who moved the item when no robot is configured
  • The validator side is unchanged, the queue topic reply and category notifications stay as they were

Notes for review:

  • Rolling back after the migration needs the notification rows purged or the extension properly disabled, or leftover rows point at types that no longer exist
  • The attention notification still notifies a moderator of their own report, matching the old email dispatcher, preserved deliberately
  • Every status move posts, including Awaiting Approval and Awaiting Denial; a small filter can exclude those two if they should stay internal until the decision follows

Resolves #452
Resolves #450

ECYaz added 2 commits August 7, 2026 08:37
Titania subscription events were emailed directly through the legacy
messenger, invisible to the board's notification bell and the UCP
notification options. Route them through the notification manager
instead: five data-driven notification types (posted, contribution,
queue, queue_move sharing the queue option, attention) select their
recipients from the existing watch table and render the existing email
templates through the email method, so watchers now get board and/or
email delivery per their UCP preferences.

The watch table remains the source of what a user subscribed to; the
subscribe UI and UCP subscriptions module are unchanged. To keep
subscribing meaning mail-me for everyone, a migration adds an email
preference row for every existing watcher (the board method delivers
by default without a row) and new users get default email rows for the
Titania types at registration, exactly like the core does for its post
and topic types.

The attention and no-validation revision dispatches move after their
rows are inserted, since the notification needs the item id. Deleting
a post, revision, queue item or contribution now also deletes the
notifications that point at it.
When a validator moves a submission between queue statuses, nothing
tells the authors. Only the validator facing queue topic gets a reply
and only tag watchers are notified.

Post a status update to the queue discussion topic on every move, as
the contribution type's robot when one is configured. The authors can
see that topic and are subscribed to it by default, and since
programmatic posts do not notify topic subscribers on their own, send
the same posted notification a reply through the posting form would.
Validators keep the notifications they already had.
@iMattPro

iMattPro commented Aug 10, 2026

Copy link
Copy Markdown
Member

I can see the validation topic discussion being updated, but there is no notification added for those (and I'm subscribed to the it).

Also, I'm not sure we want to advertise when a contribution is moved to awaiting approval or denial. For sure when moved to testing and/or validating. But if they know we add them to awaiting *** that's going to open up the door for them to bug us about that - they should not learn the "verdict" of validation/testing until we finally approve or deny.

A status update was posted to the queue discussion topic on every
move, including moves to awaiting approval and awaiting denial. The
authors should not learn the verdict of validation before it is
final, so limit the announcement to the moves worth announcing to
them, the start of validating and of testing. The validator facing
queue topic reply and the queue tag notifications are unchanged and
still cover every move.
@ECYaz

ECYaz commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Fixed, the status update post is now only made for moves to Validating and Testing. About the notification, the user who performs the move is excluded from his own notification, another subscribed account receives the bell and the email as expected.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates Titania “watch/subscription” events from the legacy direct-email messenger into phpBB’s notification framework so they can appear in the notification bell and UCP notification preferences, while preserving the existing email templates. It also adds author-visible validation status updates by posting into the queue discussion topic (robot user when configured, otherwise the acting validator).

Changes:

  • Replaced legacy subscription emailing with phpBB notification types (posted, contribution, queue, queue_move, attention) and routed existing events through notification_manager.
  • Added migrations + user-registration defaults to preserve historical “subscribed implies emailed” behavior while enabling board notifications.
  • Added cleanup (deleting stale notifications when underlying objects are deleted) and queue status update posts to the validation discussion topic.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
subscriptions.php Replaces legacy messenger-based emails with notification_manager->add_notifications(...) and strips sid from stored notification URLs.
posting.php Updates posting workflow to dispatch “posted” notifications via the new subscription notification path.
notification/type/base.php Adds a Titania notification-type base class handling recipient selection from watch pairs and email template integration.
notification/type/posted.php Implements the “posted” notification type with actor-based titles (via user loader).
notification/type/contribution.php Implements the “contribution revision released” notification type.
notification/type/queue.php Implements the “new queue item in watched queue” notification type with availability gating.
notification/type/queue_move.php Adds a distinct type for queue moves while sharing the same UCP option as queue.
notification/type/attention.php Implements “attention” notifications with availability based on moderation permissions.
migrations/notifications_integration.php Seeds email notification preferences for existing watchers to avoid losing emails post-migration.
language/en/notifications.php Adds the notification group, option labels, and notification title strings.
language/en/manage.php Adds the status-update post language string used for queue discussion updates.
includes/objects/revision.php Defers contribution notifications until the revision row exists; removes notifications on revision deletion.
includes/objects/queue.php Sends queue_move notifications, posts status updates to queue discussion topic, and cleans up queue notifications on delete.
includes/objects/post.php Cleans up posted/attention notifications when posts are hard-deleted.
includes/objects/contribution.php Cleans up attention notifications when contributions are deleted.
includes/objects/attention.php Sends attention notifications after insert so the attention id exists; selects appropriate title language key.
includes/objects/attention_types/post.php Routes approval-related posted notifications through the new notification system with proper watch pairs and titles.
ext.php Enables/disables/purges the extension’s notification types during extension lifecycle steps.
event/main_listener.php Loads notification language globally and seeds default email delivery for new users.
controller/manage/queue/item.php Passes robot user id (or fallback) into queue move to attribute status-update posts.
controller/contribution/revision.php Sends queue notifications via the new notification system when a revision is added.
config/services.yml Registers the new notification type services and updates DI wiring (subscriptions + posting changes).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread migrations/notifications_integration.php
Comment thread notification/type/base.php
Comment thread posting.php Outdated
The posting service never uses the injected path helper, so the dependency is dropped. The migration's existing preference lookup listed duplicate notification types in its IN clause, now filtered with array_unique.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deliver subscription notifications through the phpBB notification system Feature: Add status notification / communication

3 participants