What is a dunning email? Process, cadence, and recovery rates explained
A dunning email is a transactional message triggered by a failed payment event to recover revenue through automated retry logic. It requires webhook triggers, idempotent retry handling, and state machine tracking to recover failed payments without manual intervention.
On this page
TL;DR: A dunning email is a transactional message triggered by a failed payment event, not a marketing campaign. It is part of an event-driven state machine that tracks retry count, next retry date, and customer status. Recovery rates fall sharply as time elapses, so early cadence design and channel escalation matter more than the total number of emails sent. Dunning requires webhook triggers, idempotent retry logic, and suppression list separation from marketing sends. If your dunning setup splits transactional delivery and event tracking across two providers, send.io handles both under one API, with delivery, bounce, and complaint webhooks on the same contact layer.
Your payment gateway just fired a webhook for a failed charge, and what happens next determines whether you recover that revenue. Most dunning advice focuses on subject lines and copy, but the recovery rate is determined by your webhook payload, retry logic, and cadence enforcement.
A dunning email is not a marketing message. It is an event-driven, state-machine-controlled transactional email that fires when a payment retry fails. The email itself is the visible output, but the system that triggers it, the webhook payload that feeds it, and the cadence that spaces it are what determine recovery. The sections below map the webhook trigger, the retry state machine, the cadence design, and the recovery benchmarks a dunning system requires.
Understanding the automated dunning trigger
In SaaS, dunning combines payment retry logic with customer communication that fires when a payment processor webhook reports a failed subscription payment.
Core purpose of dunning emails
A dunning email is a transactional message sent when a payment retry fails, and it is part of a state machine that tracks retry count, next retry date, and customer status. Payment failure events trigger dunning emails, not marketing calendars, and the emails must carry retry state to be useful.
The distinction between dunning and payment retry is critical. Payment retry is the machine reattempting the charge against the card issuer. Dunning is the customer-facing messaging that asks the customer to update their payment method.
Dunning trigger events explained
Webhook events from your payment processor trigger dunning emails. The invoice.payment_failed event fires most commonly, occurring whenever an invoice payment attempt fails. According to Stripe's API documentation, this event occurs due to either a declined payment (including soft declines) or the lack of a stored payment method.
The invoice.payment_failed webhook carries an attempt_count attribute that indicates how many payment attempts have been made so far. This field is critical for dunning systems because it lets you track retry state and adjust messaging based on whether this is the first failure or the fifth. The next_payment_attempt attribute on the invoice indicates the date when the payment processor will attempt the next collection, which is essential for scheduling your dunning email cadence.
Dunning vs. payment reminders and win-back campaigns
Dunning and payment reminders are often confused, but they serve different purposes and operate on different triggers. A payment reminder is a scheduled message sent before or after a due date, regardless of whether a payment has failed. A dunning email is an event-driven message sent specifically when a payment attempt fails. Dunning addresses involuntary churn, which happens when a payment fails. Win-back campaigns address voluntary churn, which happens when a customer actively cancels.
Automating dunning workflows
Dunning workflows are event-driven, not schedule-driven. When a payment fails, your billing system fires a webhook to your application, which transitions the subscription to a dunning state and triggers the first dunning email. The workflow then tracks retry attempts, updates the subscription status, and escalates messaging based on the number of failed attempts and the time elapsed.
The key difference from a payment reminder is that dunning requires state awareness. Your dunning system needs to know the current retry count, the next scheduled retry date, the decline code, and the customer's subscription status. This state determines what message to send, when to send it, and whether to escalate to a different channel or suspend access.
Automating billing system triggers
Dunning workflows respond to three billing trigger categories: soft declines, hard declines, and expired payment methods. Soft declines are temporary failures that may succeed if retried, such as insufficient_funds or try_again_later. According to industry analysis of Stripe decline codes, soft declines represent 60-70% of all payment failures. Hard declines indicate permanent issues requiring customer action, such as expired_card or fraudulent, and should not be automatically retried.
If a failure returns a hard decline code, Stripe cannot retry the invoice payment without a new payment method. Retries continue to be scheduled and attempt_count continues to increment, but retries only execute after detecting a new payment method.
Distinguishing churn types for dunning
Involuntary churn occurs when a customer's subscription lapses because a payment failed, such as an expired card or a declined transaction, rather than because the customer chose to cancel. According to Recurly's glossary definition, this makes involuntary churn a largely preventable form of revenue loss that dunning and account-updater tools are designed to catch.
Research from Paddle cited by Baremetrics puts involuntary churn at 20-40% of total churn for subscription businesses. The average subscription business loses roughly 9% of monthly recurring revenue to failed payments, according to Digital Applied's failed payment recovery playbook. This is the revenue that dunning systems are designed to recover.
Setting effective dunning deadlines
Dunning deadlines define how long you attempt to recover a failed payment before suspending access or canceling the subscription. Recurly does not recommend dunning cycles longer than 28 days for monthly plans because longer cycles cause invoices to enter a loop state where new invoices are issued even though prior invoices were not collected. This guidance comes from Recurly's dunning best practices.
The dunning window should align with your retry schedule and communication cadence. A typical dunning window for a monthly subscription is 14-21 days, with retry attempts spaced 3-5 days apart and dunning emails sent after each failed retry. The final dunning email should clearly state the deadline and the consequence of non-payment.
Under the hood of payment failure recovery
Payment failure recovery is an event-driven state machine. When a payment fails, your billing system fires a webhook, your application transitions the subscription to a dunning state, triggers a dunning email, and schedules the next retry. The system tracks retry count, next retry date, decline code, and customer status to determine the next action.
Detecting billing errors via webhooks
Billing errors are detected through webhook events from your payment processor. The invoice.payment_failed event is the primary trigger, but you also need to handle charge.failed, customer.subscription.updated, and payment_method.attached events to track the full lifecycle. Each webhook payload carries the data your dunning system needs to make decisions.
The webhook payload for a dunning trigger should include customer ID, failed payment amount, retry count, next retry date, decline code, and subscription status. Here is a minimal webhook payload contract:
Field | Type | Example | Purpose |
|---|---|---|---|
| string |
| Identify the customer |
| integer |
| Amount in cents |
| integer |
| Number of attempts so far |
| string (ISO 8601, UTC) |
| When the next retry is scheduled |
| string |
| Why the payment failed |
| string |
| Current subscription state |
Designing resilient delivery cadences
A resilient dunning cadence spaces retry attempts and customer communications to maximize recovery without overwhelming the customer. Stripe's default retry behavior waits 3 days after the first failure, then retries and sends webhooks with attempt_count equal to 2. According to Stunning's analysis of Stripe retry behavior, this pattern continues on 5-day intervals.
Stripe recommends a maximum of 8 retries within 2 weeks for Smart Retries, according to Churnbuster's Stripe dunning analysis. Recurly recommends dunning emails scheduled every 4-5 days within the dunning window, according to Recurly's dunning documentation. Align your email cadence with your retry schedule so customers receive a dunning email after each failed retry attempt.
Setting up dunning email triggers
Fire dunning email triggers on the first payment failure webhook event, not on every subsequent retry attempt. According to a DEV Community walkthrough of a Stripe dunning flow, invoice.payment_failed fires on every automatic retry, so sending one email per event can produce eight near-identical emails on the default Smart Retries schedule (up to 8 tries within 2 weeks). The first dunning email should fire immediately after the first invoice.payment_failed event, and subsequent emails should fire on a schedule aligned with your retry cadence.
Here is a Node.js webhook handler that parses a payment failure event and triggers a send.io transactional email with idempotency protection:
const crypto = require('crypto');
async function handlePaymentFailed(event) {
const invoice = event.data.object;
// Generate unique idempotency key per invoice + attempt combination
const idempotencyKey = crypto
.createHash('sha256')
.update(`${invoice.id}-${invoice.attempt_count}`)
.digest('hex');
const response = await fetch('https://api.sendio.run/emails', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.SENDIO_API_KEY}`,
'Idempotency-Key': idempotencyKey,
'Content-Type': 'application/json'
},
body: JSON.stringify({
from: 'billing@yourdomain.com',
to: invoice.customer_email,
subject: 'Payment failed - action required',
html: renderDunningEmail(invoice),
tags: ['dunning', `attempt-${invoice.attempt_count}`]
})
});
if (!response.ok) {
throw new Error(`send.io API error: ${response.status}`);
}
return response.json();
}
The Idempotency-Key header ensures that if your webhook handler retries the send.io API call due to a network timeout or a 5xx error, send.io returns the original result instead of sending a duplicate email. send.io stores idempotency keys for 24 hours, so retries within that window are safe. Send the header on every request. send.io does not derive a key from the request content, so a request without the header has no deduplication protection.
Mapping subscription status changes
Subscription status changes map to different stages in the dunning workflow. When a payment fails, the subscription transitions from active to past_due. After the final retry attempt fails, the subscription transitions to unpaid or canceled, depending on your billing system configuration.
The customer.subscription.updated webhook fires when the subscription status changes, and the status field tells you the current state. Your dunning system should listen for this event and update its internal state machine. If the subscription transitions to active because a retry succeeded, your dunning system should stop sending dunning emails and send a payment recovery confirmation instead.
Optimizing recovery with a multi-touch email cadence
A multi-touch dunning cadence sends a series of emails spaced over the dunning window, with each email escalating in urgency and specificity. The cadence should align with your retry schedule so customers receive a dunning email after each failed retry attempt.
Day 0-7 - Early recovery attempts
The first dunning email fires immediately after the first invoice.payment_failed webhook event. This email should be factual and low-pressure: inform the customer that their payment failed, provide the reason if available (decline code), and give them a direct link to update their payment method. Most first-time failures are soft declines or expired cards the customer does not know about.
The second dunning email fires after the second failed retry attempt, typically 3-5 days after the first failure. This email should escalate the urgency slightly: remind the customer that their payment is still failing, restate the amount and the next retry date, and emphasize that their service will be affected if the payment is not resolved. If the decline code indicates a soft decline like insufficient_funds, suggest that the customer ensure sufficient funds are available before the next retry.
Day 10-14 - Final recovery attempts and closeout
The third dunning email fires after the third or fourth failed retry attempt, typically 10-14 days after the first failure. This email should clearly state the deadline and the consequence of non-payment. If your dunning window is 14 days, state that service will be suspended or the subscription will be canceled if payment is not resolved by a specific date.
The final dunning email fires after the last retry attempt fails, when the customer.subscription.updated webhook reports the subscription status as unpaid or canceled. Configure the template to read the status field from that payload so it states whether the subscription is suspended or canceled, and to render the final amount owed from the invoice's amount_due and currency fields. Include a self-serve reactivation URL that routes the customer to a payment update page, so reactivation does not require contacting support.
Reducing churn with multi-stage triggers
Multi-stage triggers combine email, in-app messaging, and access control to maximize recovery. Email is the primary channel, but in-app messages and access restrictions provide additional touchpoints that catch customers who do not read email or who need a stronger signal that their account is at risk.
In-app messaging for dunning flows
In-app messaging complements email by reaching customers when they log into your application. When a customer with a failed payment logs in, display a banner or modal that informs them of the payment failure and provides a direct link to update their payment method. This catches customers who ignore email but actively use your product.
The in-app message should mirror the dunning email cadence: low-pressure on day 0, more urgent on day 3-7, and a clear deadline on day 10-14. The message should dismiss after the customer updates their payment method, and it should not block access until the final dunning stage.
Tracking delivery status with send.io webhooks
send.io's event webhooks carry delivery, bounce, and complaint events with message ID, event type, timestamp, and recipient on every event. Bounce events include a bounce object with type (Permanent or Transient), subtype, a message, and the per-recipient diagnostic code. On send.io's sending IPs, bounce events also include the raw SMTP response, the DSN code, and the sending IP, according to send.io's API documentation.
For dunning systems, these webhook events let you track whether the dunning email actually reached the customer. If a dunning email bounces, your dunning system can flag the customer's email address as invalid and escalate to an alternative contact method or flag the account for manual review. If a customer marks a dunning email as spam, your dunning system can suppress future dunning emails to protect sender reputation.
Access control triggers for unpaid accounts
Access control triggers restrict application access based on subscription status. After the final dunning email, if payment has not been resolved, your application should restrict access to paid features while allowing the customer to update their payment method. This creates urgency without completely locking the customer out.
The access control logic should check the subscription status on every authenticated request. If the status is past_due and the dunning window has not expired, allow full access but display the in-app dunning message. If the status is unpaid or the dunning window has expired, restrict access to paid features and redirect to a payment update page.
Quantifying recovery rates by retry attempt
Recovery rates measure the percentage of failed payments that are successfully recovered through retries and dunning. The industry median recovery rate is 47.6%, according to Digital Applied's failed payment recovery playbook.
First dunning attempt success rates
The first dunning attempt recovers the largest share of failed payments, because most first-time failures are soft declines or expired cards the customer did not know about. Default Stripe retry behavior recovers 30-40% of failed payments, according to Recurflux's dunning guide. This recovery happens without any dunning emails, purely from the payment processor's retry logic.
Adding a dunning email to the first retry attempt increases recovery by prompting customers to update expired cards or ensure sufficient funds before the next scheduled retry. The first dunning email is the highest-leverage touchpoint in the entire dunning workflow, because it catches customers who would not have recovered on their own.
Impact of cadence on recovery yield
Recovery rates vary by retry strategy. Recurly's AI-powered dunning recovers 70-80% of failed payments, according to US Tech Automations' platform comparison. The same comparison states that AI-optimized dunning recovers 15-20% more failed payments than rule-based systems.
Automated dunning with ML optimization recovers 70-80% of initially failed payments, Chargebee's configurable dunning recovers 60-70%, and manual dunning by customer success managers recovers 40-50%, according to US Tech Automations' Chargebee vs. Recurly comparison.
Variables affecting retry success
Retry success depends on the decline code, the time elapsed since the failure, the customer's payment method, and the retry timing. Soft declines like insufficient_funds have higher retry success rates than hard declines like expired_card, because soft declines are temporary issues that resolve on their own or with minimal customer action.
Test the send.io side of the dunning flow in the send.io sandbox: provision a scoped API key, configure a test webhook endpoint, and fire a test send to verify idempotency keys prevent duplicate sends and delivery webhooks return the diagnostic codes you need for programmatic bounce handling.
FAQs
How does a dunning email work with payment retries?
A dunning email fires when a payment retry fails, not on every retry attempt. The email is triggered by the invoice.payment_failed webhook event, which carries the retry count and next retry date, so your dunning system can track state and adjust messaging based on how many attempts have failed.
What happens if a customer ignores all dunning emails?
If a customer ignores all dunning emails and the dunning window expires, the subscription transitions to unpaid or canceled, and access to paid features is restricted. The customer can reactivate by updating their payment method, but the subscription does not automatically resume without customer action.
Should dunning emails come from a named sender on your own domain?
Yes, use a dedicated address on your own domain so transactional billing messages stay separate from marketing sends and your marketing sender reputation stays protected from dunning-related spam complaints, but make the sender a named person rather than a generic billing@ or noreply@ address. According to Baremetrics dunning email guidance, emails from an individual (for example, "Sarah from Acme" payments@yourdomain.com) see open rates rise around 15% over generic system addresses like billing@yourdomain.com, which tend to get archived instead of opened.
How do you test a dunning sequence without charging real cards?
Use your payment processor's test mode with test card numbers that trigger specific decline codes. Stripe provides test cards like 4000000000000002 for card_declined, and the Stripe CLI can trigger test webhooks locally. Other processors provide similar test tooling in their documentation.
Key terms glossary
Dunning: Dunning is the automated process of communicating with customers when a payment fails, with the goal of recovering the revenue without manual intervention. The term comes from the old practice of "dunning" someone for payment, which meant repeatedly asking them to pay.
Involuntary churn: Involuntary churn happens when a customer's subscription lapses because a payment failed, such as an expired card or a declined transaction, rather than because the customer chose to cancel. This makes it a largely preventable form of revenue loss that dunning systems are designed to catch.
Payment retry logic: Payment retry logic is the automated process of reattempting a failed charge against the card issuer. Retry logic is separate from dunning: retries run against the issuer, dunning runs against the inbox, and both are necessary for payment failure recovery.
Grace period: A grace period is the time between a payment failure and the suspension or cancellation of service. The grace period defines the dunning window and determines how long you attempt to recover the failed payment before taking action.