MailChimp

Use MailChimp to send Magic Link emails

First of all, configure MailChimp.

For this to work you only need the MAILCHIMP_API_KEY environment variable configured.

Follow this guide to set it.

Open src/config/auth.ts and set

import { emailFrom } from "@/config";
import { sendTransactionaEmail } from "@/libs/mailchimp"

/* ... */

providers: [
    EmailProvider({
      async sendVerificationRequest({identifier: email, url}) {
        await sendTransactionalEmail({
          to: email,
          from: emailFrom,
          subject: "Sign In to MyApp",
          text: `Please click here to authenticate - ${url}`,
        })
      },
    })
  ],

Last updated