Skip to main content

Method 3) Custom method

This method allows you provide a callback using which you can send emails however you like. The input to the callback will be email template variables, so you can freely design the email as well. Use this method if you are:

  • Using a third party email service like Mailchimp.
  • You want to do some custom spam protection before sending the email.
  • You already have an email sending infrastructure and want to use that.
import supertokens from "supertokens-node";
import ThirdParty from "supertokens-node/recipe/thirdparty";
import Session from "supertokens-node/recipe/session";
import EmailVerification from "supertokens-node/recipe/emailverification"

appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
recipeList: [

emailDelivery: {
override: (originalImplementation) => {
return {
sendEmail: async function (input) {
// TODO: create and send email verification email

// Or use the original implementation which calls the default service,
// or a service that you may have specified in the emailDelivery object.
return originalImplementation.sendEmail(input);

If you call the original implementation function for sendEmail, it will use the service that you have configured. If you have not configured any service, it will use the default service.

So using this method, you can for example, have your custom way of sending email verification emails, but use the default or SMTP service to send the reset password emails.


When using this callback, you must manage sending the email yourself.

Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI