A live read and live frames for the Email Campaigns home widget

FeatureEmailService
Shipped
September 16, 2026 at 3:10 PM UTC
Author
Kamo
Commit
a66182e

GET /api/email/widget/campaigns is the launchpad widget's one read, built for a pane that sits on every campaign viewer's home page all day: lean rows with no body (CampaignLine), live campaigns first (sending, paused, scheduled soonest), then the most recently finished and the most recently edited drafts, each group capped; exact counts per group; every shown campaign's opens, clicks and relay reports in one pipelined Redis read; the organization's last fourteen days; its tracking choice; and the server clock for countdowns. It takes VIEW_BULK_EMAIL, as the campaigns list does. Three kinds of frame now ride /topic/campaigns/<orgId> beside progress: - engagement: CampaignEngagementPulse coalesces first opens, first clicks and relay reports per campaign and sends at most one frame a second per pod, with what is new since the last frame and the totals as Redis holds them. - changed: CampaignController announces a member's create, edit, delete, duplicate, schedule, send, pause, resume, cancel, audience and recipient changes after the service call has committed, as an id and a verb only. - Neither carries a top-level campaignId. Every campaigns screen reads a frame with one as progress and copies its counters onto the row, so a frame of another shape carrying one would blank the counts on screens still running the older code. The sender also counts the day's accepted messages once per batch (stats.daily "sent"), which the widget's two-week sparklines draw from. The full suite is 1534 tests with one failure, TransactionalSendRatchetTest, which counts three sendToUser overloads since c47fcf6 and is unrelated.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing