Skip to main content

Pre / Post Hooks / Override

We provide you funtionality to run code before and after an email is sent. You can use this for:

  • Logging purposes
  • Spam protection purposes
  • Modifying the email template variables before sending the emails
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: [

// if email verification is enabled
emailDelivery: {
override: (originalImplementation) => {
return {
sendEmail: async function (input) {
// TODO: run some logic before sending the email

await originalImplementation.sendEmail(input);

// TODO: run some logic post sending the email
Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI