Receive Scenario-Triggered Engagement Notification When Activity Gap Detected
The scenario engine evaluates each peer mentor's activity history on a scheduled basis. When a defined inactivity threshold is exceeded (e.g., 7 days without a logged activity), the system constructs a contextual push notification and dispatches it to the peer mentor's device via FCM. The notification includes a scenario-specific message that acknowledges the inactivity pattern and prompts action, and tapping it deep-links directly into the activity registration wizard so the mentor can log a session immediately without navigating manually.
User Story
Acceptance Criteria
- 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
- Given the notification is delivered, When the mentor opens the notification centre, Then the scenario prompt notification card is visible with the correct message content and timestamp
- Given a mentor has already logged an activity after the threshold was crossed but before the next evaluation run, When the edge function runs, Then no duplicate notification is dispatched
Business Value
HLF reported that 40% of peer mentors were unsatisfied with the follow-up they received. Proactive scenario-triggered notifications close the engagement gap by prompting mentors before inactivity becomes a problem, directly improving reporting completeness and mentor retention without requiring coordinator manual intervention.
Components
- Scenario Prompt Notification Card ui
- Scenario Rule Engine service
- Scenario Prompt Scheduler Service service
- Scenario Evaluation Edge Function infrastructure
- Push Notification Dispatcher infrastructure
- Scenario Rule Repository data
- Prompt History Repository data
- Scenario Deep Link Handler service
- FCM Token Manager infrastructure
- In-App Notification Repository data