feat: marketing email campaign service#351
Merged
Merged
Conversation
Full end-to-end marketing email system: Backend: - MarketingCampaign + MarketingEmailLog EF models and migration - ApplicationUser: add MarketingOptOut/MarketingOptOutAt fields - UserSegmentService: 5 segments (no-uploads, stuck-under-minimum, has-uploads-no-model, inactive-30d, all-verified) - MarketingEmailService: campaign CRUD, schedule, cancel, duplicate, test send, bulk execute with idempotent per-recipient guard - MarketingEmailBackgroundService: polls every minute, picks up due campaigns - MarketingCampaignController: full admin REST API including email preview endpoint - MarketingUnsubscribeController: token-based unsubscribe + resubscribe + status - PostmarkWebhookController: auto-unsubscribe on hard bounce / spam complaint - SendMarketingEmailAsync + RenderMarketingEmailPreview in EmailNotificationService - FirstCampaignContent: "5 selfie minimum" re-engagement email content Frontend: - AdminCampaignsComponent: list, create, detail, schedule, test send, logs views - UnsubscribeComponent: handles token-based unsubscribe link from emails - MarketingService: full Angular HTTP client for all campaign endpoints - Routes: /admin/campaigns and /unsubscribe wired up Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
simple-deploy.yml and pr-code-review.yml were still referencing 8.0.x after the .NET 10 upgrade, which would cause dotnet build/test steps to fail due to global.json requiring 10.0.201. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Added SendMarketingEmailAsync and RenderMarketingEmailPreview no-op implementations to CapturingEmailNotificationService (x2), NoopEmailNotificationService, and DummyEmailNotificationService — all broke when the interface was extended for marketing email support. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
/admin/campaignsfor creating, scheduling, previewing, and monitoring campaignsno-uploads+stuck-under-minimumusersKey files
MarketingCampaign,MarketingEmailLog,ApplicationUser(+opt-out fields)MarketingEmailService,UserSegmentService,MarketingEmailBackgroundService,FirstCampaignContentMarketingCampaignController,MarketingUnsubscribeController,PostmarkWebhookControllerAdminCampaignsComponent,UnsubscribeComponent,MarketingService20260408121713_AddMarketingEmailServiceTest plan
dotnet ef database updateto apply migration/admin/campaigns, create a campaign using the first-campaign defaultsno-uploadssegment — verify a non-zero count/unsubscribepage shows success andMarketingOptOutis set in DBPOST /api/webhooks/postmarkwithAuthorization: Bearer {PostmarkWebhookSecret}🤖 Generated with Claude Code