Generate Personalised Referral Link
The system generates a short referral URL that encodes the peer mentor's user ID and organisation slug. The Recruitment Service creates or retrieves this link on demand, ensuring it is persistent across sessions. The link is displayed in the Referral Link Widget on the recruitment screen. When a prospective member follows the link, the Referral Edge Function decodes the identifiers and pre-fills the registration flow with the correct local association context, lowering the barrier for the new member to complete sign-up.
User Story
Acceptance Criteria
- Given the peer mentor opens the recruitment screen, when the referral link widget loads, then a unique short URL is displayed that encodes their user ID and organisation slug
- Given the peer mentor's referral link has been generated, when they close and reopen the app, then the same link is shown (links are persistent, not regenerated each session)
- Given the peer mentor's link is generated, when a new user navigates to the link, then the Referral Edge Function resolves it and the registration flow is pre-filled with the referring local association
- Given the referral link is displayed, when the attribution window is 30 days (default), then sign-ups within 30 days of first clicking the link are attributed to the referrer
Business Value
Personalised referral links are the core mechanism of the feature. Encoding the user ID and organisation slug enables accurate attribution and removes the manual step of asking a new member to choose their local association — both of which are critical to adoption. Supabase Edge Function resolution supports both cold-start and warm-start deep-link scenarios on iOS and Android, ensuring the link works reliably regardless of app state.
Components
- Referral Link Widget ui
- Recruitment Service service
- Recruitment Repository data
- Referral Link Edge Function infrastructure