03-Aug-2026 — newsletter mode with an AI-drafted overview of what is coming up ref #347

build 807commit 2f05702


Groups had no way to send a periodic "what's coming up" newsletter that picks up where the last one left off. The composer could already auto-include events over a date range, but the window was seeded as today to today + 2 weeks every time, nothing remembered when the last newsletter went out, and the intro was a blank box that someone rewrote from scratch on each send.

Newsletter mode, switched on from the Events step when auto-include is active:

The intro is drafted by the existing AI capability from the selected events, through a new /api/ai/newsletter-intro endpoint. The system prompt is held server side rather than accepted from the browser, and asks for a high-level summary rather than a re-listing, with nothing invented and no greeting or sign-off since those are separate fragments. What comes back is an editable draft with an undo beside it. The AI writes the intro paragraph and nothing else: events still render through the existing fragment untouched, so no model output can reach a member as event detail.

With AI switched off the endpoint reports 503 and the composer says the intro was left as it was, so a newsletter stays composable by hand.

Window derivation and prompt input building are pure functions with 32 tests between them, covering the first newsletter, a previous window still running, one that has run out, a previous newsletter that recorded no window, custom dates, and the empty-programme case.