Repository navigation
Feat/1211 1370 1369 1371 - #1647
Merged
Merged
Conversation
…er (StreamFi-x#1369) - Create notification_preferences table with per-user notification controls - Add NotificationPreferences interface with support for in-app and email channels - Implement getNotificationPreferences, updateNotificationPreferences functions - Add preference checking functions: shouldSendInAppNotification, shouldSendEmailNotification - Implement global unsubscribe/resubscribe functionality - Include migration that populates defaults for existing users
…mFi-x#1370) - Create lib/notifications/template-engine.ts with renderNotification() - Support pluralization rules for notification content across languages - Add comprehensive English and Spanish templates for all notification types - Implement variable interpolation with proper escaping - Add writeTemplatedNotification() function for template-based writes - Deprecate hardcoded writeNotification() in favor of templated approach
…mFi-x#1369) - Replace in-memory prefsStore with database-backed storage - Update GET endpoint to support both session-based and query param lookup - Update PUT endpoint to persist updates to notification_preferences table - Add support for granular per-type notification controls - Add global unsubscribe/resubscribe functionality via unsubscribed_all flag - Implement fallback to defaults for missing user preferences
…se (StreamFi-x#1369) - Implement real-time preference fetching from database API - Add support for granular in-app and email notification toggles - Implement optimistic UI updates with server sync - Add error handling and loading states - Support per-notification-type controls for 7 in-app types and 5 email types - Add global unsubscribe button for complete opt-out - Display current user authentication status with helpful messages
- Update follow notification to check notify_follow preference - Update stream start notifications to check notify_live preference - Import shouldSendInAppNotification and writeTemplatedNotification - Skip notification delivery if user has disabled notification type - Use templated notifications with i18n support for consistent messaging
- Update tip notification webhook to check notify_tip_received preference - Update badge notification logic to check notify_system preference - Import shouldSendInAppNotification and writeTemplatedNotification - Skip notification delivery if user has disabled notification type - Support templated notifications with proper parameter passing
|
@OsagieCynthia Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Deployment failed for project streamfi-frontend with the following error: |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@OsagieCynthia is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Notification System Improvements: Preferences & Templating
Overview
This PR implements two critical improvements to StreamFi's notification system:
feat: In-app notification preferences and unsubscribe management for users #1369: In-app notification preferences and unsubscribe management - Users can now granularly control which notifications they receive across in-app and email channels, with a global unsubscribe option.
feat: Templating and localization layer for notification content #1370: Templating and localization layer for notification content - All notifications now use a centralized template system with i18n support for English and Spanish, eliminating hardcoded strings and enabling consistent, translatable messaging.
What Changed
Database Layer
notification_preferencestable with per-user, per-channel, per-type controlsAPI Endpoints
/api/routes-f/notification-preferencesfrom in-memory to database storageTemplate Engine
lib/notifications/template-engine.tswithrenderNotification()andcreateNotificationRecord(){{actor}},{{amount}}, etc.)UI Component
NotificationSettingscomponent to fetch and persist preferences in real-timeNotification Trigger Points
app/api/users/follow/route.ts- checksnotify_followbefore sendingapp/api/streams/start/route.ts- checksnotify_livebefore notifying followersapp/api/routes-f/webhooks-stellar-payment/route.ts- checksnotify_tip_receivedfor tip alertslib/routes-f/badges.ts- checksnotify_systemfor badge notificationsImplementation Details
New Files
db/migrations/20260925_notification_preferences.sqllib/notifications/template-engine.tslib/notifications/preferences.tsModified Files
app/api/routes-f/notification-preferences/route.ts- API migrationapp/api/users/follow/route.ts- Preference checkingapp/api/streams/start/route.ts- Preference checkingapp/api/routes-f/webhooks-stellar-payment/route.ts- Preference checkinglib/routes-f/badges.ts- Preference checkinglib/notifications.ts- AddedwriteTemplatedNotification()lib/i18n/translator.ts- Added notification templatescomponents/settings/notifications/NotificationSettings.tsx- UI rewriteCloses
Testing Notes
Migration Path