Customising the email sent
The default email
- From: [email protected], but the user will see your app name
- Subject:
Email verification instructions
Send a custom email 🕶️
You can take full control of sending a password reset email by providing the createAndSendCustomEmail
function during initialisation (on the backend):
supertokens.init({
supertokens: {...},
appInfo: {...},
recipeList: [
ThirdPartyEmailPassword.init({
emailVerificationFeature: {
createAndSendCustomEmail: async (user, emailVerificationURLWithToken) => {
let {id, email} = user;
// TODO:
}
}
}),
Session.init()
]
});
- You can get the user's email via the
user
input param. - Your email must direct the user to open the
emailVerificationURLWithToken
link. This link is a full URL, with the email verification token. It points to the email verification page on your website (/auth/email-verify
by default). - Any errors thrown from this function will be ignored.
- You must manage sending the email yourself if you provide this function