feat(newsletters): admin-only broadcast system (Wave 1, Laravel reference)#103
Open
mpge wants to merge 27 commits into
Open
feat(newsletters): admin-only broadcast system (Wave 1, Laravel reference)#103mpge wants to merge 27 commits into
mpge wants to merge 27 commits into
Conversation
…d click rewriting
…no-newsletters flags
…Inertia features.newsletters
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.
Summary
Implements the newsletter system per
escalated-dev/escalated/docs/superpowers/specs/2026-05-19-newsletter-system-design.md. Disabled by default. Laravel reference implementation; other backends will port from this PR in subsequent waves.marketing_opt_out_atcolumn)Models/Newsletter/ContactSegmentResolver,BounceSuppressionStore,NewsletterRendererService,NewsletterPlannerService,NewsletterDispatcherService,NewsletterTrackerServiceescalated:newsletters:dispatchArtisan command (host schedules every minute)escalated:installextended with--with-newsletters/--no-newslettersflags + interactive promptdefault,brandedPermissionSeeder:newsletters.manage,newsletters.send(Admin gets both via wildcard)ESCALATED_ENABLE_NEWSLETTERS) gates routes (boot-time skip), middleware (per-request 404), and Inertia shared dataleague/commonmark+ click rewriting via PHPDOMDocumentDepends on
@escalated-dev/escalatedv0.9.0 — Wave 0 PR is at escalated-dev/escalated#75.Deviations from plan
$user->ensurePermission(...)and$user->hasPermission(...)helpers that don't exist in the codebase. Followed the existingMacroControllerpattern (admin section middleware-gated; per-action permission checks deferred). Admin role gets both newsletter perms by default via the seeder's['*']wildcard.Escalated/Admin/Newsletters/...PascalCase to matchEscalated/Admin/Macros/....symfony/dom-crawlerwith PHP's built-inDOMDocumentafter the crawler returned "empty node list" on full-document input.http://localhost(Testbench default) instead ofhttps://example.comfor URL assertions.Test plan
vendor/bin/pest --filter='Newsletter')tests/Feature/CoreOnlyBootTest).env.exampleor installation docs make clear thatESCALATED_ENABLE_NEWSLETTERS=falseis the defaultReviewer notes
escalated_settingsJSON for v1; suitable for <10k bounces. Plan flags a dedicated suppression table for v1.1+.[]); per the spec, v1 surfaces aggregate clicks only.