Skip to content

Display email delivery statistics#222

Open
jkbcz wants to merge 3 commits into
masterfrom
add-notification-email-stats
Open

Display email delivery statistics#222
jkbcz wants to merge 3 commits into
masterfrom
add-notification-email-stats

Conversation

@jkbcz

@jkbcz jkbcz commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
  1. Adds UI for displaying delivery statistics when sending out an email
  2. The new UI is only enabled for new emails, because we didn't store the notification id, so it's impossible to fetch statistics for older notifications.

@jkbcz jkbcz requested a review from cs1m0n July 14, 2026 11:01

Copilot AI left a comment

Copy link
Copy Markdown

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 adds support for displaying (and manually refreshing) email delivery statistics for sent notifications in the bcc-login editor UI by persisting the CoreAPI notification id + delivery stats in post meta and exposing a REST endpoint to refresh stats.

Changes:

  • Persist notification id, type, and delivery statistics in sent_notifications meta when sending notifications.
  • Add a REST endpoint to refresh delivery statistics by fetching the notification from CoreAPI and updating stored meta.
  • Replace the “sent notifications” UI from a simple table to a per-notification summary + delivery statistics section with a refresh action and toast feedback.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
yarn.lock Updates/locks dependencies pulled in by the UI + tooling changes.
plugins/bcc-login/src/visibility.js Stops pre-formatting sent_notifications and passes raw meta through to the list component.
plugins/bcc-login/src/components/sent-notifications-list.js New UI for listing sent notifications and showing/refreshing delivery statistics.
plugins/bcc-login/src/components/send-notifications.js Dispatches an updated notifications payload after sending.
plugins/bcc-login/includes/class-bcc-notifications.php REST endpoints now return updated notifications; adds refresh-statistics endpoint; stores delivery stats.
plugins/bcc-login/includes/class-bcc-login-visibility.php Extends REST meta schema for sent_notifications (adds id/type/stats); removes sanitize callback.
plugins/bcc-login/includes/class-bcc-coreapi-client.php send_notification() returns decoded JSON; adds get_notification() helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/bcc-login/src/components/sent-notifications-list.js
Comment thread plugins/bcc-login/src/components/sent-notifications-list.js
Comment thread plugins/bcc-login/src/components/sent-notifications-list.js
Comment thread plugins/bcc-login/src/components/sent-notifications-list.js
Comment thread plugins/bcc-login/src/components/sent-notifications-list.js
Comment thread plugins/bcc-login/includes/class-bcc-notifications.php
Comment thread plugins/bcc-login/includes/class-bcc-notifications.php
Comment thread plugins/bcc-login/includes/class-bcc-notifications.php
Comment thread plugins/bcc-login/includes/class-bcc-coreapi-client.php
Comment thread plugins/bcc-login/includes/class-bcc-login-visibility.php
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.

2 participants