Skip to content

Send Better Auth emails from Loops

Call Loops from Better Auth’s email callbacks to send verification, password reset, magic link, and one-time code emails, each from its own Loops template.

Better Auth callbacksendResetPassword
sendVerificationEmailsendMagicLinksendVerificationOTP
A
Reset your Acme passwordAcme · to Sam
••••••••

Reset your password

Hi Sam, we got a request to reset your Acme password. Choose a new one with the button below.

Reset password
Didn’t ask for this? Your password stays the same.
AcmeQuestions? Just reply to this email.
More

Every auth method covered

Email and password, magic link, and email OTP each get their own templates.

Verify and reset

Email and password sign-in sends verification and password reset emails with the URL and token from Better Auth.

The magic link plugin’s sendMagicLink callback sends each link through your Loops template.

One-time codes

Email OTP covers sign in, email verification, and password reset, with the code in a data variable.

Designed in Loops

Build each email in the Loops editor and add the data variables Better Auth fills in.

How it connects

A small server helper sends each email with the Loops SDK. The docs include the full code.

Install the SDK

Add the Loops JavaScript SDK with npm i loops, then set your API key and transactional IDs.

One server helper

A helper calls sendTransactionalEmail. Keep it on the server so your API key stays private.

Better Auth callbacks

sendVerificationEmail, sendResetPassword, sendMagicLink, and sendVerificationOTP each call the helper.

Frequently asked questions

Which Better Auth emails can Loops send?

Verification and password reset emails for email and password sign-in, magic link emails, and email OTP codes for sign in, email verification, and password reset. Create a Loops transactional email for each one you use.

How does Better Auth call Loops?

Through the Loops JavaScript SDK. A server-side helper calls sendTransactionalEmail with a transactional ID, the user’s email address, and data variables, and each Better Auth callback calls that helper.

Do the data variable names matter?

They have to match. Names like verificationUrl, magicLinkUrl, and otpCode are suggestions, but the names in your Better Auth code and in your Loops emails must be the same.

Should the callbacks await the send?

Better Auth recommends not awaiting email sends in these callbacks, to reduce timing-attack risk and keep auth responses fast. The docs use void, or waitUntil if your platform supports background work.

Why aren’t my Better Auth emails sending?

Check that each transactional email is published, that its data variable names match your code, that the API key is valid and from the right account, and that your sending domain is verified.

Is there a free plan?

Yes. The free plan includes unlimited contacts and up to 4,000 emails to your first 1,000 contacts in any rolling 30-day window, marketing and transactional combined. Upgrade to send to more subscribed contacts.