LogoZonai

Built-in Templates

The six built-in email templates and when they are used.

Zonai ships six HTML email templates for the standard auth flows. They are stored in emailTemplatesPath and can be edited directly — changes take effect without recompiling.

The Six Built-in Templates#

verify_email.html#

Sent when email.send.verifyEmail(...) is called (typically in onSignUp).

VariableDescription
emailThe recipient's email address
verificationUrlThe full URL the user clicks to verify their address
expiresInHuman-readable expiry (e.g. "24 hours")

otp_code.html#

Sent automatically when POST /auth with type: "sendOtp" is called.

VariableDescription
emailThe recipient's email address
otpThe numeric OTP code
expiresInHuman-readable expiry (e.g. "10 minutes")

magic_link.html#

Sent automatically when POST /auth with type: "sendMagicLink" is called.

VariableDescription
emailThe recipient's email address
magicLinkUrlThe full sign-in link
expiresInHuman-readable expiry

password_reset.html#

Sent automatically when POST /auth/reset-password is called.

VariableDescription
emailThe recipient's email address
passwordResetUrlThe full password reset link
expiresInHuman-readable expiry
nameThe user's name (if provided)

confirm_change_email.html#

Sent when an email address change requires confirmation.

VariableDescription
emailThe new email address
confirmUrlThe confirmation link
expiresInHuman-readable expiry

login_notice.html#

Sent when email.send.loginNotice(...) is called (typically in onSignIn).

VariableDescription
emailThe recipient's email address

Customizing Templates#

Edit the HTML files in emailTemplatesPath directly. Templates use Mustache syntax.

Templates are read at send time — no recompile needed after editing.

To create a new template, see Custom Templates.