TemplatesAccounts and access

Verification code email template

A one-time code set large enough to read from another screen.

From
Northwind <[email protected]>
Subject
Your Northwind verification code
Preview text
Your Northwind verification code
Preview of the Verification code template
verify-code.txt
Your {{productName}} verification code

Confirm your email

Enter this code to finish signing in to {{productName}}. It expires in {{expiryMinutes}} minutes.

{{code}}

If you did not ask for this, nothing has happened yet and you can ignore this message, because the code is useless on its own.

{{footerNote}}

Shown with sample values. The HTML and plain-text tabs keep the placeholders.

About

When to send it

Send it to confirm an address or finish a sign-in. The code sits on its own line in large type, the expiry is given in minutes, and the closing line tells anyone who did not ask that the code is useless on its own.

5 values to fill

What each send fills in

Required values have to come with every send. The rest fall back to the default shown here.

PlaceholderKindRequiredDefault
{{productName}}TextRequiredNone
{{code}}TextRequiredNone
{{expiryMinutes}}TextOptional10
{{footerNote}}TextOptionalYou are receiving this because somebody asked to sign in.
{{unsubscribeUrl}}LinkOptionalNone

API

Send it from your code

Create a template from this design once, then send it with the values for each message.

import { init, nextmail } from '@nextmail/sdk' init({ apiKey: process.env.NEXTMAIL_API_KEY }) await nextmail.templates.create({  name: 'Verification code',  slug: 'verify-code',  starter: 'verify-code',  publish: true,}) const sent = await nextmail.templates.send('verify-code', {  from: 'Northwind <[email protected]>',  to: '[email protected]',  props: {    productName: 'Northwind',    code: '482913',  },}) console.log(sent.id, sent.status)

Accounts and access

More templates like this

Preview of the Welcome template

Welcome

A sign-up welcome with a short greeting, one button to get started and the link written out underneath.

6 styles
Preview of the Welcome card template

Welcome card

A compact welcome in a card, with one button back into the product.

6 styles
Preview of the Magic link template

Magic link

Passwordless sign-in with one button and the link printed as text.

6 styles
Preview of the Password reset template

Password reset

A reset email with one button, a link to paste and a clear expiry.

6 styles

Start from one

Pick a design, change anything,
and send it from your code.

Every template opens in the editor as blocks you can move, restyle or delete, and sends through the API with the values filled in.