SuperTokens

SuperTokens

  • Docs
  • Discord
  • Blog

›Email Verification

SIDEBAR_REPLACE_DOC_Introduction

  • Introduction

Quick setup

  • Video tutorial
  • Frontend
  • Backend

Common customizations

  • Sign Out
  • Sign Up Form

    • Prerequisite
    • Adding Extra Fields
    • Adding / Modifying field validators
    • Embed in a page
    • Handling signup success
    • Terms of service & Privacy policy links
    • Show Sign Up by default

    Sign In Form

    • Prerequisite
    • Adding / Modifying field validators
    • Password managers
    • Embed in a page

    Reset Password

    • About
    • Reset password email
    • Embed in a page

    Email Verification

    • About
    • Customising the email sent
    • Embed in a page

    Sessions

    • About

    Styling

    • Changing Colours
    • Changing Style via CSS
    • Themes

    Changing base path

    • Website Base Path
    • API Base Path

    Multi Tenancy

    • About
    • One login, many sub domains
    • One login per sub domain
  • User Pagination

NextJS

  • SuperTokens with NextJS

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: [
        EmailPassword.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
← AboutEmbed in a page →