Skip to content
send.io
All posts

Payment failed email template: the core three-email set (HTML + React Email)

Payment failed email template: Get three ready-to-use HTML and React Email templates for initial notice, retry, and final warning. Includes complete Stripe webhook parser and idempotent retry logic you can ship in under an hour without building a template system first.

On this page
TL;DR: You need three payment failed email templates: an initial notice sent promptly after the failure event, a retry-in-progress update, and a final action-required warning. This article provides copy-paste HTML and React Email components for all three, plus the Stripe webhook parser to trigger them. Send the initial notice as soon as your workflow allows, so the customer can fix the payment method before the next retry.

Your invoice.payment_failed webhook fired at 3 AM. Did your customer get an email, or did the retry silently fail? Most payment recovery guides give you copy advice. This one gives you the three emails, the webhook parser, and the React Email components to ship in under an hour.

Required modules for payment recovery

Use the core three-email set: initial notice, retry-in-progress, and final warning. Each maps to a specific stage in the recovery lifecycle.

Email

Suggested Timing

Suggested Subject Line

Suggested CTA

Purpose

Initial Notice

Promptly after failure (as soon as your workflow allows)

Action required: Your payment failed

Update payment method

Notify of failed charge, provide immediate retry link

Retry Update

After an automatic retry fails (suggested: attempt_count of 2)

We're retrying your payment

Update payment method

Inform of automatic retry schedule, set expectations

Final Warning

Several days before suspension

Final notice: Update payment before your account is downgraded

Update payment method now

Last chance before account downgrade or suspension

Email 1: initial payment failure notice

Stripe fires the first invoice.payment_failed event, and you send this email promptly. The recipient knows an action is required. No source here measures open rates for this email, so track them against your own baseline.

Subject line: Action required: Your payment of $[amount] failed

Preheader (suggested): Your $[amount] payment didn't go through. Update your payment method to keep your service active.

Body copy:

Hi [customer_name],

We couldn't process your payment of $[amount] for [product_name]. This usually happens because of an expired card or insufficient funds.

What happens next: We'll automatically retry your payment on [retry_date]. To avoid any interruption, update your payment method now.

[Button: Update Payment Method]

If you already updated your payment method, you can ignore this email.

Footer: Questions? Reply to this email or contact [support_email]. You're receiving this because you have an active subscription with [company_name].

Email 2: managing pending retry attempts

Send this email after the first automatic retry fails. Keep the cadence tight: send within a few hours of each retry failure to maintain urgency.

Subject line: We're retrying your payment of $[amount]

Preheader: Automatic retry scheduled for [retry_date]. Update your payment method now.

Body copy:

Hi [customer_name],

We tried to process your payment of $[amount] again, but it didn't go through. We'll make another automatic attempt on [retry_date].

To avoid service interruption: Update your payment method before the next retry.

[Button: Update Payment Method]

If your payment method is already up to date, no action is needed.

Footer: Need help? Contact [support_email]. This is a transactional message related to your [company_name] subscription.

Email 3: account suspension notice

Send this email before the suspension or downgrade date, inside the grace period you configure for your billing workflow. Grace period lengths vary widely in practice, so treat the length as a policy variable and schedule this email within it. This is the final warning with explicit consequences.

Subject line: Final notice: Update payment before your [product_name] account is downgraded

Preheader: Your account will be downgraded on [suspension_date] without payment.

Body copy:

Hi [customer_name],

We've attempted to process your payment of $[amount] multiple times without success. Your account is scheduled for downgrade on [suspension_date].

To keep your account active: Update your payment method immediately.

[Button: Update Payment Method Now]

After [suspension_date], your account will be downgraded to the free plan, and you'll lose access to [premium_features].

Footer: This is your final notice. Contact [support_email] with questions. [company_name] will not send further payment reminders.

Standardized email templates for failed charges

These HTML templates work across Gmail, Apple Mail, and Outlook. Keep subject lines concise, lead with the specific dollar amount, and use one CTA per email.

Payment failed email template HTML

Copy-paste HTML for the initial payment failure notice. Inline CSS is the most reliable styling approach across email clients.

Email 1: initial payment failure notice

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payment Failed</title>
</head>
<body style="margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background-color: #f4f4f4;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color: #f4f4f4;">
<tr>
<td align="center" style="padding: 40px 20px;">
<table role="presentation" width="600" cellpadding="0" cellspacing="0" style="background-color: #ffffff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
<!-- Header -->
<tr>
<td style="padding: 40px 40px 20px 40px;">
<img src="[logo_url]" alt="[company_name]" width="150" style="display: block; max-width: 150px; height: auto;">
</td>
</tr>
<!-- Body -->
<tr>
<td style="padding: 0 40px 20px 40px;">
<h1 style="margin: 0 0 16px 0; font-size: 24px; font-weight: 600; color: #1a1a1a; line-height: 1.3;">Your payment of $[amount] failed</h1>
<p style="margin: 0 0 16px 0; font-size: 16px; color: #4a4a4a; line-height: 1.5;">Hi [customer_name],</p>
<p style="margin: 0 0 16px 0; font-size: 16px; color: #4a4a4a; line-height: 1.5;">We couldn't process your payment of <strong>$[amount]</strong> for [product_name]. This usually happens because of an expired card or insufficient funds.</p>
<p style="margin: 0 0 24px 0; font-size: 16px; color: #4a4a4a; line-height: 1.5;"><strong>What happens next:</strong> We'll automatically retry your payment on [retry_date]. To avoid any interruption, update your payment method now.</p>
</td>
</tr>
<!-- CTA -->
<tr>
<td align="center" style="padding: 0 40px 32px 40px;">
<a href="[payment_update_url]" style="display: inline-block; padding: 14px 32px; background-color: #2563eb; color: #ffffff; text-decoration: none; font-size: 16px; font-weight: 600; border-radius: 6px;">Update Payment Method</a>
</td>
</tr>
<!-- Secondary text -->
<tr>
<td style="padding: 0 40px 32px 40px;">
<p style="margin: 0; font-size: 14px; color: #6b7280; line-height: 1.5;">If you already updated your payment method, you can ignore this email.</p>
</td>
</tr>
<!-- Footer -->
<tr>
<td style="padding: 24px 40px; background-color: #f9fafb; border-top: 1px solid #e5e7eb; border-radius: 0 0 8px 8px;">
<p style="margin: 0 0 8px 0; font-size: 13px; color: #6b7280; line-height: 1.5;">Questions? Reply to this email or contact <a href="mailto:[support_email]" style="color: #2563eb; text-decoration: none;">[support_email]</a></p>
<p style="margin: 0; font-size: 13px; color: #9ca3af; line-height: 1.5;">You're receiving this because you have an active subscription with [company_name].</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

Email 2 variant: replace the heading and body sections in Email 1 with:

<h1 style="margin: 0 0 16px 0; font-size: 24px; font-weight: 600; color: #1a1a1a; line-height: 1.3;">We're retrying your payment</h1>
<p style="margin: 0 0 16px 0; font-size: 16px; color: #4a4a4a; line-height: 1.5;">Hi [customer_name],</p>
<p style="margin: 0 0 16px 0; font-size: 16px; color: #4a4a4a; line-height: 1.5;">We tried to process your payment of <strong>$[amount]</strong> again, but it didn't go through. We'll make another automatic attempt on <strong>[retry_date]</strong>.</p>
<p style="margin: 0 0 24px 0; font-size: 16px; color: #4a4a4a; line-height: 1.5;"><strong>To avoid service interruption:</strong> Update your payment method before the next retry.</p>

Email 3 variant: replace the heading and body sections in Email 1 with:

<h1 style="margin: 0 0 16px 0; font-size: 24px; font-weight: 600; color: #dc2626; line-height: 1.3;">Final notice: Update payment before your account is downgraded</h1>
<p style="margin: 0 0 16px 0; font-size: 16px; color: #4a4a4a; line-height: 1.5;">Hi [customer_name],</p>
<p style="margin: 0 0 16px 0; font-size: 16px; color: #4a4a4a; line-height: 1.5;">We've attempted to process your payment of <strong>$[amount]</strong> multiple times without success. Your account is scheduled for downgrade on <strong>[suspension_date]</strong>.</p>
<p style="margin: 0 0 8px 0; font-size: 16px; color: #4a4a4a; line-height: 1.5;"><strong>To keep your account active:</strong> Update your payment method immediately.</p>
<p style="margin: 0 0 24px 0; font-size: 16px; color: #4a4a4a; line-height: 1.5;">After [suspension_date], your account will be downgraded to the free plan, and you'll lose access to [premium_features].</p>

To signal urgency in the final warning, you can set the CTA button background color to #dc2626, the footer background to #fef2f2, and the footer border color to #fecaca. These hex values are illustrative, not a required or standard palette for payment failure emails. Adjust them to match your brand palette, and check that the text contrast stays readable in light and dark mode.

CSS best practices for email templates

Inline CSS remains the safest styling approach for email. Gmail has supported embedded CSS since 2016, but embedded styles stop rendering when someone opens the Gmail app with a non-Gmail account (GANGA), and Outlook desktop ignores embedded styles because it renders email with the Word engine. Stick to table-based layouts, avoid flexbox or grid, and test both light and dark mode across Apple Mail and Gmail.

Supported React Email component versions

React Email's latest version is 6.11.10 on the npm registry. The npm registry marks the @react-email/components package as deprecated, with the author message "Package no longer supported," so use the main react-email package instead. (Note: React Email's Tailwind integration uses 16px-based units for email client compatibility.)

Failed payment email template structure

Install React Email:

npm install react-email@6.11.10

Component hierarchy and props interface:

import {
Body,
Button,
Container,
Head,
Heading,
Html,
Img,
Link,
Preview,
Section,
Text,
} from 'react-email';

interface PaymentFailureEmailProps {
customerName: string;
amount: string;
productName: string;
retryDate: string;
paymentUpdateUrl: string;
supportEmail: string;
companyName: string;
logoUrl: string;
}

Failed transaction retry logic

React Email component for the initial payment failure notice:

export function InitialPaymentFailureEmail({
customerName,
amount,
productName,
retryDate,
paymentUpdateUrl,
supportEmail,
companyName,
logoUrl,
}: PaymentFailureEmailProps) {
return (
<Html>
<Head />
<Preview>Your ${amount} payment didn't go through. Update your payment method to keep your service active.</Preview>
<Body style={main}>
<Container style={container}>
<Section style={header}>
<Img src={logoUrl} alt={companyName} width="150" style={logo} />
</Section>
<Section style={content}>
<Heading style={h1}>Your payment of ${amount} failed</Heading>
<Text style={text}>Hi {customerName},</Text>
<Text style={text}>
We couldn't process your payment of <strong>${amount}</strong> for{' '}
{productName}. This usually happens because of an expired card or
insufficient funds.
</Text>
<Text style={text}>
<strong>What happens next:</strong> We'll automatically retry your
payment on {retryDate}. To avoid any interruption, update your
payment method now.
</Text>
</Section>
<Section style={buttonContainer}>
<Button style={button} href={paymentUpdateUrl}>
Update Payment Method
</Button>
</Section>
<Section style={content}>
<Text style={secondaryText}>
If you already updated your payment method, you can ignore this
email.
</Text>
</Section>
<Section style={footer}>
<Text style={footerText}>
Questions? Reply to this email or contact{' '}
<Link href={`mailto:${supportEmail}`} style={link}>
{supportEmail}
</Link>
</Text>
<Text style={footerSubtext}>
You're receiving this because you have an active subscription with{' '}
{companyName}.
</Text>
</Section>
</Container>
</Body>
</Html>
);
}

const main = {
backgroundColor: '#f4f4f4',
fontFamily:
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
};

const container = {
backgroundColor: '#ffffff',
margin: '40px auto',
borderRadius: '8px',
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
maxWidth: '600px',
};

const header = { padding: '40px 40px 20px 40px' };
const logo = { display: 'block', maxWidth: '150px', height: 'auto' };
const content = { padding: '0 40px 20px 40px' };

const h1 = {
margin: '0 0 16px 0',
fontSize: '24px',
fontWeight: '600',
color: '#1a1a1a',
lineHeight: '1.3',
};

const text = {
margin: '0 0 16px 0',
fontSize: '16px',
color: '#4a4a4a',
lineHeight: '1.5',
};

const buttonContainer = { padding: '0 40px 32px 40px', textAlign: 'center' as const };

const button = {
backgroundColor: '#2563eb',
borderRadius: '6px',
color: '#ffffff',
fontSize: '16px',
fontWeight: '600',
textDecoration: 'none',
textAlign: 'center' as const,
display: 'inline-block',
padding: '14px 32px',
};

const secondaryText = { margin: '0', fontSize: '14px', color: '#6b7280', lineHeight: '1.5' };

const footer = {
padding: '24px 40px',
backgroundColor: '#f9fafb',
borderTop: '1px solid #e5e7eb',
borderRadius: '0 0 8px 8px',
};

const footerText = { margin: '0 0 8px 0', fontSize: '13px', color: '#6b7280', lineHeight: '1.5' };
const footerSubtext = { margin: '0', fontSize: '13px', color: '#9ca3af', lineHeight: '1.5' };
const link = { color: '#2563eb', textDecoration: 'none' };

Implementing the final warning email

For the final warning email, use the same component structure with these style variants:

const urgentH1 = { ...h1, color: '#dc2626' };
const urgentButton = { ...button, backgroundColor: '#dc2626' };
// Illustrative colors: match your brand palette
const urgentFooter = { ...footer, backgroundColor: '#fef2f2', borderTop: '1px solid #fecaca' };
const urgentFooterText = { ...footerText, color: '#991b1b' };
const urgentFooterSubtext = { ...footerSubtext, color: '#7f1d1d' };
const urgentLink = { color: '#dc2626', textDecoration: 'none' };

Update the heading text to "Final notice: Update payment before your account is downgraded" and add the suspension date and premium features to the body copy.

Defining the template schema

TypeScript interface for template props with validation:

import { z } from 'zod';

// Example schema: this is an illustrative validation pattern, not an official or standard schema.
// Adjust the field names, regexes, and constraints to your data model.
export const PaymentFailureEmailSchema = z.object({
customerName: z.string().min(1),
// Example: amounts as a decimal string, such as "49.00", or a whole number, such as "4900" for JPY.
// Stripe's invoice.amount_due is an integer in the smallest currency unit, so this
// string comes from your own formatting step, for example (amount_due / 100).toFixed(2).
// Tighten or loosen the pattern to match your currencies and formatting.
amount: z.string().regex(/^\d+(\.\d{2})?$/, 'Amount must be a numeric string such as "49.00"'),
productName: z.string().min(1),
retryDate: z.string().min(1),
paymentUpdateUrl: z.string().url(),
supportEmail: z.string().email(),
companyName: z.string().min(1),
logoUrl: z.string().url(),
suspensionDate: z.string().optional(),
premiumFeatures: z.string().optional(),
});

export type PaymentFailureEmailData = z.infer<typeof PaymentFailureEmailSchema>;

Validate props before rendering:

const validatedData = PaymentFailureEmailSchema.parse(rawData);

Implementing automated payment failure triggers

Stripe's invoice.payment_failed webhook delivers subscription payment failure events and retry updates. Parse the webhook payload, map fields to template variables, and send the appropriate email based on attempt_count.

Processing Stripe webhook payloads

Parse the Stripe invoice.payment_failed event with error handling and idempotent retry logic:

import Stripe from 'stripe';

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET;

export async function handleStripeWebhook(req: Request) {
const sig = req.headers.get('stripe-signature');
const body = await req.text();

let event: Stripe.Event;

try {
event = stripe.webhooks.constructEvent(body, sig, webhookSecret);
} catch (err) {
console.error('Webhook signature verification failed:', err);
return new Response('Webhook Error', { status: 400 });
}

if (event.type === 'invoice.payment_failed') {
const invoice = event.data.object as Stripe.Invoice;

try {
await processFailedPayment(invoice);
return new Response('Success', { status: 200 });
} catch (err) {
console.error('Failed to process payment failure:', err);
return new Response('Processing Error', { status: 500 });
}
}

return new Response('Event not handled', { status: 200 });
}

async function processFailedPayment(invoice: Stripe.Invoice) {
const attemptCount = invoice.attempt_count || 1;
const customer = await stripe.customers.retrieve(invoice.customer as string);

const idempotencyKey = `payment-failed-${invoice.id}-attempt-${attemptCount}`;

const templateData = {
customerName: customer.name || 'Customer',
customerEmail: customer.email,
amount: (invoice.amount_due / 100).toFixed(2),
productName: invoice.lines.data[0]?.description || 'your subscription',
// Stripe sets next_payment_attempt to null when no retry is scheduled, such as after a hard decline.
// Leave retryDate undefined in that case instead of inserting vague text like "soon",
// and use retry-free copy for that customer.
retryDate: invoice.next_payment_attempt
? new Date(invoice.next_payment_attempt * 1000).toLocaleDateString()
: undefined,
paymentUpdateUrl: `${process.env.APP_URL}/billing/update-payment`,
supportEmail: process.env.SUPPORT_EMAIL,
companyName: process.env.COMPANY_NAME,
logoUrl: process.env.LOGO_URL,
};

if (attemptCount === 1) {
await sendEmail('initial-payment-failure', templateData, idempotencyKey);
} else if (attemptCount === 2) {
await sendEmail('retry-in-progress', templateData, idempotencyKey);
} else if (attemptCount === 3) {
// Illustrative pattern: derive the suspension date from a configurable grace period,
// not a hardcoded offset. Set GRACE_PERIOD_DAYS from your own billing policy.
// Grace period lengths vary widely in practice, and Stripe doesn't prescribe a standard length.
// The default of 10 below is an example value only.
// invoice.created approximates the first failure; anchor to your own failure timestamp if you store one.
const gracePeriodDays = Number(process.env.GRACE_PERIOD_DAYS ?? 10);
const suspensionDate = new Date(invoice.created * 1000);
suspensionDate.setDate(suspensionDate.getDate() + gracePeriodDays);

// Example placeholder: source premium features from your own plan data.
await sendEmail('final-warning', {
...templateData,
suspensionDate: suspensionDate.toLocaleDateString(),
premiumFeatures: process.env.PREMIUM_FEATURES,
}, idempotencyKey);
}
}

async function sendEmail(
templateId: string,
data: any,
idempotencyKey: string
) {
const response = await fetch('https://api.send.io/emails', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.SENDIO_API_KEY}`,
'Idempotency-Key': idempotencyKey,
},
body: JSON.stringify({
from: process.env.BILLING_FROM_EMAIL,
to: data.customerEmail,
template: {
id: templateId,
variables: data,
},
}),
});

if (!response.ok) {
throw new Error(`Failed to send email: ${response.statusText}`);
}

return response.json();
}

Stripe skips automatic retries when the card issuer returns hard decline codes like incorrect_number, lost_card, stolen_card, or authentication_required. For hard declines, send the initial failure email immediately and skip retry emails.

When to send each payment email

Attempt Number

Days After Failure

Email Sent

Trigger

1

0

Initial notice

First invoice.payment_failed event (attempt_count of 1)

2

Varies with your retry schedule

Retry update (suggested mapping)

Second invoice.payment_failed event (attempt_count of 2)

3

Varies with your retry schedule

Final warning (suggested mapping)

Third invoice.payment_failed event (attempt_count of 3)

Stripe's attempt_count attribute on the invoice.payment_failed webhook reports how many attempts have been made so far. This article maps one email to each of the first three attempts, but Stripe's Smart Retries can run up to 8 attempts within 2 weeks by default. Stripe doesn't prescribe which email to send at each attempt, so this mapping is a suggested convention. Gate sending on your own attempt_count threshold and adjust it to your retry schedule.

Send the initial notice promptly after the first failure event, as soon as your workflow allows. No source sets a required time window for this email. Configure retry intervals in your Stripe dashboard under Billing > Settings > Subscriptions and emails.

Data binding for failed payment templates

Map webhook payload fields to template variables:

Variable Name

Data Type

Source

Example Value

customer_name

string

customer.name

Customer's display name

amount

string

invoice.amount_due / 100

Amount due formatted to two decimals

product_name

string

invoice.lines.data[0].description

"Pro Plan"

retry_date

string

invoice.next_payment_attempt

"November 15, 2026"

payment_update_url

string

Environment variable

"https://app.example.com/billing"

support_email

string

Environment variable

"support@example.com"

company_name

string

Environment variable

"Acme Inc"

logo_url

string

Environment variable

"Hosted logo image URL"

In this template set, the three emails share the core variables customer_name, amount, product_name, payment_update_url, support_email, company_name, and logo_url. The Email 2 template in this article uses retry_date in its preheader and body copy, so it needs the retry_date variable. The Email 3 template uses suspension_date in its preheader and body copy and premium_features in its body copy, so it needs both variables. Adjust the set to your own template requirements.

Testing payment failure flows

Test webhook payloads without triggering real payment failures:

  1. Use Stripe CLI to trigger test webhooks:

stripe trigger invoice.payment_failed

  1. Test with send.io's template test rendering through the send.io API with your template ID and test data.
  2. Verify idempotency: Send the same webhook payload twice with the same Idempotency-Key header. The second request should return the original result without sending a duplicate email.

Best practices for payment failure email copy

Copy decisions in payment failure emails come down to four areas: wording, call-to-action count, retry messaging, and footer disclosure. The subsections below cover each one.

Refining copy for payment recovery

Use clear action verbs, specific amounts, and direct links. Replace "Click here" with "Update payment method." Lead with the dollar amount in the subject line: "Action required: Your payment of $49.00 failed." A specific amount tells the recipient which charge failed and what action to take before they open the email. No source here measures the effect on open rates, so test subject lines against your own audience.

Prioritizing actions in failure emails

Use a single CTA per email. The primary action is always "Update payment method." Don't include secondary CTAs like "View invoice" or "Contact support" in the button area. Put support links in the footer as plain text.

Guidelines for payment retry messaging

Be transparent about the retry schedule. Tell the customer exactly when the next retry will happen: "We'll automatically retry your payment on November 15, 2026." Don't use vague language like "soon" or "in a few days." A specific date tells the customer how long they have to update their payment method, which can reduce the questions they would otherwise send to support. No source here measures the effect on support tickets or trust, so track both against your own baseline.

Standardizing footer disclosure text

Include required legal and support information in every footer:

  • Support email address
  • Company name
  • Reason for receiving the email ("You're receiving this because you have an active subscription")
  • For final warning emails, add explicit final notice language: "This is your final notice. [Company] will not send further payment reminders."

Mandatory tweaks for your billing workflow

The three emails depend on billing settings outside the templates: branding, support routing, retry intervals, and the downgrade window. The subsections below cover how to configure each one.

Configuring your logo and color palette

Upload your logo and set brand colors in the send.io template editor. The visual editor lets you update designs and copy without touching application code, so non-engineers can iterate on email copy while developers focus on webhook logic.

Setting up support email aliases

Create a dedicated billing support address like billing@yourcompany.com and configure it as the reply-to address for payment failure emails. This routes billing questions to the right team and keeps payment recovery conversations separate from general support.

Configuring payment retry intervals

Stripe's Smart Retries chooses retry times for you based on signals about each payment attempt, so you don't set the schedule yourself. Stripe's documentation doesn't detail the model's internals, so this article doesn't describe how it picks a time. For manual configuration, Stripe's custom retry rules set each retry a number of days after the previous attempt, and Stripe doesn't prescribe a standard schedule. For example, you could set one retry each at 1, 3, and 7 days after the previous attempt in your Stripe dashboard. Configure your own intervals.

Configuring account downgrade windows

Treat the grace period between the first payment failure and account suspension as a configurable policy variable, such as GRACE_PERIOD_DAYS in the webhook handler above. Examples vary widely in practice, and Stripe doesn't prescribe a standard length. Choose a length that gives the customer time to update their payment method across multiple retry attempts. Communicate the timeline explicitly in Email 3: "Your account will be downgraded on [specific_date]."

Test the payment failure templates in the send.io sandbox with a test webhook payload. Provision a scoped API key, trigger a test invoice.payment_failed event with Stripe CLI, and verify the email renders correctly across Gmail, Apple Mail, and Outlook.

FAQs

How many days should you wait between emails?

Send Email 1 promptly after the first failure event, as soon as your workflow allows. Send Email 2 after the first retry fails. The gap depends on your retry schedule, because Stripe lets you set the number of days between retries and no source sets a fixed range. Send Email 3 before your configured suspension date, inside the grace period you set for your billing workflow. Match your email timing to your Stripe retry schedule, which you configure in Billing > Settings > Subscriptions.

Should you send all three emails for every payment failure?

No. Only send Email 1 for the first failure. Send Email 2 if the first retry fails. Send Email 3 only if multiple retries fail and your suspension date is approaching. Use the attempt_count field from the Stripe webhook to determine which email to send.

Can you use these templates with payment providers other than Stripe?

Yes. Replace the Stripe webhook parser with your payment provider's webhook event structure. Map the equivalent fields (customer name, amount, retry date) to the template variables. The HTML and React Email templates work with any billing system.

What variables do you need to pass to each template?

All three templates in this article share customer_name, amount, product_name, payment_update_url, support_email, company_name, and logo_url. The Email 2 template uses retry_date in its preheader and body copy, so it needs the retry_date variable. The Email 3 template uses suspension_date in its preheader and body copy and premium_features in its body copy, so it needs both variables. Adjust the set to your own template requirements.

How do you test these emails without triggering real payment failures?

Use Stripe CLI to trigger test webhooks: stripe trigger invoice.payment_failed. Test template rendering with send.io's template test endpoint. Verify idempotency by sending the same webhook payload twice with the same Idempotency-Key header.

Key terms glossary

Payment failure: A declined transaction attempt on a customer's payment method, usually due to insufficient funds, an expired card, or a hard decline code from the card issuer.

Retry schedule: The sequence of automatic payment retry attempts after an initial failure. Stripe's custom retry rules set each retry a number of days after the previous attempt, so you configure your own intervals, for example one retry each at 1, 3, and 7 days after the previous attempt, in Stripe or custom billing logic.

Dunning email: An automated email sent after a payment failure to notify the customer and request updated payment information, part of a payment recovery sequence.

Preheader text: The preview text that appears after the subject line in email clients, used to provide additional context. No source here measures its effect on open rates, so test preheaders against your own audience.

Idempotent retry: A retry mechanism using a unique key to prevent duplicate operations, ensuring the same webhook event doesn't send multiple emails.