Skip to main content
Petanque Life

Newsletter management (sys-scope)

F21.23 15 features

At a glance

Sys-scope newsletter management: list/segment/template/campaign/automation surfaces with capability and fresh-auth gates, MJML editor with live preview, drag-and-drop segment builder, seven-step campaign wizard with A/B and Litmus, full lifecycle controls, deep analytics including click heatmap and cohort views, react-flow automation builder with three preset flows, AI-assist with quota, deliverability dashboard, and global suppression list.

How it works

Newsletter is the largest sys growth surface, engineered like a real ESP. The overview at `sys/newsletter` exposes lists, segments, templates, campaigns, automations, AI assist, deliverability, suppressions, and analytics-overview. Mutations require `sys_support`-or-better; a subset (schedule, send-now, cancel, subscriber DELETE, suppression DELETE, CSV import attestation, automation enable/disable) requires fresh-auth.

Every action writes `write_sys_audit` under `newsletter.*`. Lists support platform and tenant scope, from-domain verification, archival, and subscriber CSV export/import with operator-attested consent; GDPR subscriber delete cascades events + enrolments while preserving the suppression row. The MJML template editor is a Monaco split-pane with a live iframe preview (mobile/desktop), sample-var injector, server-side MJML→HTML/text render with cache regen, and a gallery of 12+ premium starters.

The visual segment builder renders AND/OR groups over an allow-listed vocabulary with live recipient counts via `POST /segments/preview`; saved segments reuse in the campaign wizard. The 7-step campaign wizard walks audience → template → per-language content (with AI assist) → A/B variants → schedule (absolute or send-time-optimised) → Litmus cross-client preview + spam-score → review; a test-send within 24 hours is mandatory before schedule or send-now. Lifecycle actions are test-send, schedule, send-now, pause, resume, cancel; paused state persists so resume continues exactly where the dispatcher stopped.

Analytics shows sent/delivered/opened/clicked timeline, top-clicked links, per-variant bars with Wilson CIs on open/click rate, and a winner banner once `newsletter-ab-winner-job` runs. A heatmap overlays click density on the rendered HTML with per-link tooltips. Cohort analytics slices rates by tenant, role, language, and source.

The react-flow automation builder wires trigger → wait → send → branch → exit with a drag palette and side-panel config; three preset flows (7-day onboarding, 30-day re-engagement, 90-day win-back) seed disabled and need fresh-auth to enable. AI-assist offers three tabs (subject lines, content polish, audience reaction) backed by Gemini 2.5 Pro with a 50/operator/24h quota and prompt+response-hash audit. The deliverability dashboard tracks per from-domain reputation 0–100, 30-day trend, SPF/DKIM/DMARC badges, bounce/complaint/unsub rates, and a halt-sends action firing on bounce > 2 % or complaint > 0.1 %.

The global suppression list is a DO-NOT-SEND register with reason + `source_event_id`; removals need fresh-auth + reason. Analytics-overview rolls cross-campaign growth, churn, engagement trend, and at-risk count linked to its segment. Design tokens, keyboard nav, and WCAG AA are enforced.

Key capabilities

  • Lists with scope, from-domain verification, archival, attested CSV import/export
  • MJML template editor with live preview, sample vars, gallery of starter templates
  • Visual AND/OR segment builder with live recipient count and reusable segments
  • Campaign 7-step wizard with A/B, Litmus, spam score, mandatory 24h test-send
  • Lifecycle: test-send, schedule, send-now, pause, resume, cancel — fresh-auth on destructive actions
  • Analytics: timeline, top links, A/B bars with Wilson CI, click heatmap, cohort breakdowns
  • React-flow automation builder with three seed flows (onboarding, re-engagement, win-back)
  • AI-assist (Gemini 2.5 Pro) with 50/operator/24h quota and audit log of prompt/response hash
  • Per-domain deliverability dashboard with auto halt-sends on threshold breach
  • Global suppression list with reason + source event id; fresh-auth on remove
  • Design-system enforced: tokenised colours, keyboard nav, WCAG AA light + dark

In practice

A growth operator drafts a relaunch campaign for the new score-keeper. She picks the `prospects who joined in the last 90 days` segment (live preview shows 4 218 recipients), opens the MJML template, polishes the subject line via AI assist (3 of 50 daily quota used), and configures an A/B test on subject. The Litmus preview clears all clients; the spam score is 0.4.

She test-sends to herself, then schedules for Tuesday 09:00 with send-time optimisation. Tuesday morning the dispatcher sends; the analytics page fills in over the day, and the A/B winner job picks variant B with 19.2 percent open rate (Wilson CI excludes A's 16.1 percent). The heatmap shows two-thirds of clicks on the primary CTA; cohort analytics confirms the lift holds across languages.

Two weeks later a bounce spike on `news.petanque.life` trips the deliverability halt-sends; she fixes a misconfigured DKIM record and resumes.

Features in this subsystem

15
ID Status Features
F21.23.01 Shipped Sys /newsletter overview + lists + segments + templates + campaigns + automations + ai-assist + deliverability + suppressions + analytics-overview. All mutations gated by sys_support+ (subset sys_engineer), subset requires fresh-auth (schedule/send-now/send-now/cancel, subscriber DELETE, suppression DELETE, CSV import attestation, automation enable/disable). All actions write to write_sys_audit (newsletter.*). ✅ PL-T152
F21.23.02 Shipped List CRUD — scope (platform/tenant) + from-domain verification + archival + subscriber CSV export/import with operator-attested consent; GDPR subscriber delete cascades events + enrolments, preserves suppression row. ✅ PL-T152
F21.23.03 Shipped MJML template editor — Monaco split-pane with live iframe preview (mobile/desktop), sample-var injection, server-side MJML→HTML/text render with cache regen on save, 12+ premium starter templates in /templates/gallery. ✅ PL-T152
F21.23.04 Shipped Visual segment-builder — drag AND/OR groups with allow-listed fields + ops, live recipient-count via POST /sys/newsletter/segments/preview, sparbara segments återanvändbara i campaign-wizard. ✅ PL-T152
F21.23.05 Shipped Campaign 7-step wizard — audience→template→content per språk (AI-assist)→A/B-variants→schedule (absolut eller send-time-optimization)→Litmus cross-client-preview+spam-score→review. Test-send obligatorisk inom 24h före schedule/send-now. ✅ PL-T152
F21.23.06 Shipped Campaign lifecycle actions — test-send, schedule, send-now, pause, resume, cancel. Fresh-auth på schedule/send-now/cancel. Paused state persisterad; resume fortsätter där dispatcher stannade. ✅ PL-T152
F21.23.07 Shipped Campaign analytics — timeline (sent/delivered/opened/clicked), top-clicked links, per-variant bars med Wilson-CI på open/click-rate, winner-banner när newsletter-ab-winner-job kört. ✅ PL-T152
F21.23.08 Shipped Heatmap-vy — click-density-overlay på rendered HTML, tooltip per <a> med link_id + click-count + unique-count via click-koordinat-aggregation. ✅ PL-T152
F21.23.09 Shipped Cohort-analytics — open/click/unsub-rate per tenant/role/language/source; CSV-export. ✅ PL-T152
F21.23.10 Shipped Visual automation-flow-builder (react-flow) — trigger→wait→send→branch→exit, drag-palette, step-config i side-panel, 3 preset-flows (7-day onboarding, 30-day re-engagement, 90-day win-back) seed-installed disabled. Enable kräver fresh-auth. ✅ PL-T152
F21.23.11 Shipped AI-assist playground — tre flikar (subject-lines, content-polish, audience-reaction) via Gemini 2.5 Pro, quota 50/operator/24h via newsletter_ai_quota-counter, quota-visning i UI. Alla calls audit-loggade med prompt+response-hash. ✅ PL-T152
F21.23.12 Shipped Deliverability-dashboard per from-domain — reputation 0–100 + 30d trend, SPF/DKIM/DMARC-badges, bounce/complaint/unsub 30d-rater, spam-score-history, halt-sends-action vid threshold-breach (bounce > 2 %, complaint > 0.1 %). ✅ PL-T152
F21.23.13 Shipped Suppressions-vy — global DO-NOT-SEND-lista med reason + source_event_id, search+filter, add (manual) / remove (fresh-auth + reason). ✅ PL-T152
F21.23.14 Shipped Analytics-overview — cross-campaign list growth, churn rate, engagement trend, at-risk-subscriber-count med länk till segment. ✅ PL-T152
F21.23.15 Shipped Design-system-efterlevnad — inga råa hex-literaler, inga inline shadowOpacity, inga ad-hoc fontFamily; keyboard-nav + focus-rings; WCAG AA i både ljus/mörk mode; ARIA-roller på segment/flow-builder. ✅ PL-T152