Repository navigation
Add opt-in newsletter signup and admin tools - #544
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
A moderate active finding remains because Newsletter.tsx bypasses the appFunctions emulator-aware wrapper, causing local emulator runs to call deployed functions and preventing authenticated newsletter flows from working correctly.
1 open issue
What changed in this PR
Adds authenticated newsletter subscription management and administrator campaign tools backed by Firebase callable functions, integrating the feature into notification settings and the moderation dashboard.
Changes:
- Adds opt-in and opt-out newsletter subscription controls for signed-in users.
- Adds campaign drafting, audience previews, queueing, and delivery-result views for administrators.
- Adds newsletter navigation and styling across the notifications and moderation interfaces.
| File | Description |
|---|---|
| src/components/NewsletterSubscription.tsx | Connects signed-in users to the newsletter subscription panel. |
| src/components/newsletter/Newsletter.tsx | Implements subscription management, administrator campaign workflows, previews, queueing, and delivery-result views. |
| src/components/newsletter/newsletter.css | Provides styling for newsletter panels, forms, controls, and status messages. |
| src/app/notifications/page.tsx | Links notification settings users to newsletter subscription management. |
| src/app/moderation/ModerationQueue.tsx | Adds an administrator-only Newsletter tab to the moderation dashboard. |
Review effort: Lite
| }; | ||
|
|
||
| async function call<T>(region: string, name: string, request: Record<string, unknown>) { | ||
| const result = await httpsCallable<Record<string, unknown>, T>(getFunctions(getApp(), region), name)(request); |
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.

Adds an opt-in newsletter signup page and a Newsletter tab to the existing admin dashboard. Administrators can draft a campaign, preview recipient counts and check delivery results.
The newsletter backend is a separate Firebase codebase. Publish this frontend after its project has the newsletter endpoints. Campaign sending starts disabled.
Verified locally with the site build and Firebase Auth/Firestore emulator tests.