feat(newsletters): full HTTP layer + engine services (Go)#69
Open
mpge wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Brings escalated-go from schema+renderer-only to full newsletter parity. Go had the 5 tables (in
migrationStatements()) + models + only the Renderer service. This ports the remaining engine + the entire HTTP layer.Part of the full-parity program (mirrors the Laravel + NestJS references against
escalated/docs/superpowers/specs/2026-06-02-newsletter-http-parity-contract.md).Added
services/newsletter/services.go+sqlstore.go): BounceSuppressionStore, ContactSegmentResolver (allowlisted fields/ops + parameterized query builder — no injection), NewsletterPlanner, NewsletterDispatcher (DispatchBatch with the 4 fleet behaviors: rate-limit/minute, retry backoff vianext_attempt_at, auto-pause over first-N, stuck-row reclaim), NewsletterTracker.handlers/newsletter.go,router/newsletter.go): admin (campaigns/lists/templates/settings), public (open-pixel, click, unsubscribe show/store, view-in-browser), ESP webhook (postmark/mailgun/ses/sendgrid), wired into BOTH routers (chi.go+stdlib.go).EnableNewslettersadded to config; routes + worker gated.newsletters.manage(admin) /newsletters.send(send actions) enforced.Residual bug fixed
models/newsletter.goCreatedBy/AddedBy/SentBywere*int64while the DDL usesuserCol(VARCHAR for uuid hosts) — would fail at scan time on uuid-keyed hosts. Now*UserID. (The prior fix(newsletter): wire newsletter schema into the migration runner #68 fix wired the schema only.)Verification
go build ./...: pass.go test ./...: all packages pass (services + handlers + migrations).