Scenario-Based Engagement Push Notifications
Feature Detail
Description
Intelligent, context-aware push notifications that prompt peer mentors to log activity, check in after a period of inactivity, celebrate a milestone, or act on an expiring certification. Notifications are triggered by specific scenarios rather than sent on a fixed schedule, reducing notification fatigue while maximising relevance. Examples: 'You haven't logged an activity in 3 weeks — is everything OK?', 'You just hit 50 sessions this year — great work!', or 'Your certification expires in 30 days — book your renewal course.' HLF explicitly requested this capability as part of improved peer mentor follow-up.
Analysis
Directly addresses the 40% peer mentor follow-up dissatisfaction from HLF's survey. Reduces coordinator manual follow-up burden. Keeps peer mentors engaged and reduces silent churn — where volunteers simply stop without formally resigning.
Trigger logic implemented in Supabase Edge Functions reacting to database events and scheduled checks. Notification content localised and personalised per user. Users can configure notification preferences (opt-out per scenario type). Deep-link notifications to the relevant in-app screen. Respect WCAG 2.2 AA for in-app notification banners.
Components (203)
Shared Components
These components are reused across multiple features
User Interface (59)
Service Layer (52)
Data Layer (33)
Infrastructure (54)
User Stories (5)
As a As a Peer Mentor (Likeperson)
I want to see a dismissible in-app notification banner at the top of the screen when a scenario prompt arrives while I am actively using the app
So that I do not miss important scenario prompts even when I already have the app open and push notifications are suppressed by the OS
- Given the mentor is actively using the app and a new scenario notification record is inserted for their user ID, When the Supabase realtime subscription fires, Then the in-app notification banner appears at the top of the screen within 2 seconds
- Given the in-app banner is displayed, When the mentor taps it, Then the scenario notification detail view opens and the banner dismisses
- Given the in-app banner is displayed, When 5 seconds elapse without interaction, Then the banner dismisses automatically and the notification remains unread in the notification centre
- +2 more
As a As a Peer Mentor (Likeperson)
I want to open the notification preferences screen and control which scenario-based notification types I receive and through which channel (push, in-app, or both)
So that I can tailor my notification experience to match my working style without being overwhelmed by prompts
- Given the mentor navigates to notification preferences, When the screen loads, Then all scenario notification types are listed with their current push and in-app toggle states correctly reflecting stored preferences
- Given the mentor toggles off push notifications for the inactivity reminder scenario, When the scenario evaluation edge function next runs and finds an inactivity condition for that mentor, Then no FCM push notification is sent but an in-app notification record is still created if in-app is enabled
- Given the mentor toggles off all channels for a scenario type, When the condition for that scenario is met, Then no notification of any kind is created for that scenario type for that mentor
- +2 more
As a As a Peer Mentor (Likeperson)
I want to open the notification centre and see a filterable list of all scenario prompts I have received, including read and unread status
So that I can review past prompts I may have dismissed, understand the pattern of reminders I receive, and act on any I missed
- Given the mentor opens the notification centre, When scenario notification records exist for their account, Then they appear in the list ordered by timestamp descending with the correct scenario type label and icon
- Given the mentor has unread scenario notifications, When they open the notification centre, Then unread items are visually distinguished from read items and the tab badge shows the correct unread count
- Given the mentor taps the scenario filter option in the notification filter bar, When the filter is applied, Then only scenario-type notifications are displayed and all other types are hidden
- +3 more
As a As a Peer Mentor (Likeperson)
I want to open a scenario notification and see a detailed view explaining why I received it, what action is suggested, and a direct call-to-action button
So that I understand the context behind the prompt and can act on it immediately without confusion
- Given a scenario push notification exists in the notification centre, When the mentor taps on it, Then the scenario notification detail view opens showing the scenario type, trigger explanation, and a contextual action button
- Given the detail view is open, When the mentor taps the primary action button, Then the scenario deep-link router navigates them to the correct screen (activity wizard, contact detail, etc.) based on the scenario type
- Given the mentor views the detail screen, When they have not previously read this notification, Then the notification read service marks it as read and the unread badge count decrements
- +2 more
As a As a Peer Mentor (Likeperson)
I want to receive a timely push notification when the system detects I have not logged any activity for a configurable number of days
So that I am gently reminded to keep my activity records up to date and maintain consistent engagement with my assigned contacts
- Given a peer mentor has not logged any activity for the configured inactivity threshold, When the scenario evaluation edge function runs its scheduled check, Then a push notification is delivered to all registered FCM tokens for that mentor
- Given the push notification is delivered, When the mentor taps it, Then the app opens and navigates directly to the activity registration bottom sheet via the scenario deep-link handler
- Given the mentor has disabled scenario-based notifications in their preferences, When the inactivity threshold is exceeded, Then no push notification is sent for that scenario type
- +2 more