User Referrals
This boilerplate comes with user referrals (refera a friend) out of the box to allow users to refer friends and get rewards for that
Things like sending the appropiate email, creating a referral page have been configured in advance. You just have to enable the 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:
Then, when his friends clicks the link in the email he will redirected to the 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:
This boilerplate doesn’t come with rewards out of the box. You’ll have to create the custom logic for it as referral rewards are quite different for each app.
For instance, for Reelify, I’ve decided to give both users video credits to create more videos. However, for another app that could be giving one month for free.