This boilerplate comes with user referrals (refera a friend) out of the box to allow users to refer friends and get rewards for that
REFERRAL_INVITE
email inside the email.config.ts
file.
Here’s how it works:
If a user is on the app/refer
page and submits the form - the following email will be sent to his friend:
auth/sign-up
page which includes the referralCode
in the URL like so */2mrw.dev/auth/sign-up/mode=magic-link:ref=5ZHA81
.
If his friend now signs up with the referral code our processReferralSignup
fn will be called where we can add some custom code to decide what the friend / or both users should get for a successful referral: