TemplatesOrders and billing

Payment failed email template

A declined charge, with the amount, the card, the retry date and what happens next.

Use this templateUse this templateAll templates8 values to fillPlain-text part included
From
Northwind <hello@example.com>
Subject
We could not charge your card for Northwind
Preview text
We could not charge your card for Northwind
Preview of the Payment failed template
payment-failed.txt
We could not charge your card for {{productName}}

Your payment did not go through

We tried to charge {{amount}} for {{productName}} and the card ending {{cardLast4}} was declined. This is usually an expired card or a bank blocking an unfamiliar charge rather than anything to do with your account.

We will try again on {{retryDate}}. {{consequence}}

Update payment method [{{actionUrl}}]

{{footerNote}}

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

About

When to send it

Send it when a charge is declined. It names the amount and the card, explains the usual causes calmly, says when the next attempt will be, and gives one button to update the payment method.

Values

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
{{amount}}TextRequiredNone
{{cardLast4}}TextOptional••••
{{retryDate}}TextRequiredNone
{{consequence}}TextOptionalIf it fails again your plan pauses, and nothing is deleted.
{{actionUrl}}LinkRequiredNone
{{footerNote}}TextOptionalYou are receiving this because you have an active subscription.
{{unsubscribeUrl}}LinkOptionalNone

API

Send it from your code

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

send-payment-failed.ts
import { init, nextmail } from '@nextmail/sdk' init({ apiKey: process.env.NEXTMAIL_API_KEY }) const template = await nextmail.templates.create({  name: 'Payment failed',  starter: 'payment-failed',  publish: true,}) const sent = await nextmail.templates.send(template.slug, {  from: 'Northwind <hello@example.com>',  to: 'maya@example.com',  props: {    productName: 'Northwind',    amount: '£49.00',    cardLast4: '4242',    retryDate: '4 October',    actionUrl: 'https://example.com/billing',  },}) console.log(sent.id, sent.status)

Orders and billing

More templates like this

Preview of the Order shipped template

Order shipped

A shipping notice with the order number, carrier and delivery estimate in a details table.

Preview of the Shipping update template

Shipping update

A dispatch notice with the carrier, a tracking number set in mono and the delivery address.

Preview of the Order receipt template

Order receipt

An order confirmation with up to three line items and a total.

Preview of the Payment receipt template

Payment receipt

A receipt with the amount charged, what it was for, the card used and a link to the invoice.

Preview of the Invoice template

Invoice

An invoice notice with the number, issue date, due date and amount due.

Preview of the Renewal notice template

Renewal notice

Advance notice of a renewal, with the plan, the date and the amount.

Preview of the Trial ending template

Trial ending

A trial reminder that says what actually happens on the last day.

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.