> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elasticfunnels.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscription Emails & Dunning

> Configure lifecycle emails for renewals, failed payments, pre-renewal reminders, pauses, and cancellations

ElasticFunnels sends automated emails at key points in the subscription lifecycle. The dunning system automatically retries failed charges on a configurable schedule and escalates to your call center if needed.

## Subscription Email Templates

Five subscription-specific email templates are available:

<CardGroup cols={2}>
  <Card title="Renewal Success" icon="circle-check">
    Sent after a successful subscription charge. Confirms the renewal and shows the next billing date.
  </Card>

  <Card title="Renewal Failed" icon="circle-exclamation">
    Sent when a charge fails. Supports retry-aware messaging so the tone escalates with each attempt.
  </Card>

  <Card title="Pre-Renewal Reminder" icon="bell">
    Sent 3 days before the next charge. Gives customers time to update their card or make changes.
  </Card>

  <Card title="Subscription Paused" icon="circle-pause">
    Confirms that billing has been paused. Shows the resume date if one is set.
  </Card>

  <Card title="Subscription Canceled" icon="circle-xmark">
    Confirms cancellation. Includes a soft win-back CTA.
  </Card>
</CardGroup>

### Retry-Aware Dunning Emails

The renewal failed template can show different messaging based on how many retry attempts have occurred, using `@if` directives in the template editor:

```
@if(subscription.retry_count eq 1)
  We had trouble processing your payment. Don't worry — we'll try again soon.
@elseif(subscription.retry_count eq 3)
  Your payment could not be processed. Please update your payment method.
@elseif(subscription.retry_count gte 5)
  Final notice: Your subscription will be canceled unless you update your payment method.
@endif
```

This lets you start gentle and escalate the urgency as retries continue.

### Template Variables

All subscription email templates receive the standard purchase data (products, amounts, customer info) plus these subscription-specific fields:

| Variable                       | Available In                 |
| ------------------------------ | ---------------------------- |
| `subscription.cycle_number`    | All templates                |
| `subscription.next_charge_at`  | Renewal success, pre-renewal |
| `subscription.frequency_label` | All templates                |
| `subscription.retry_count`     | Renewal failed               |
| `subscription.next_retry_date` | Renewal failed               |
| `subscription.card_last4`      | Renewal failed               |
| `subscription.paused_at`       | Paused                       |
| `subscription.resume_at`       | Paused                       |
| `subscription.canceled_at`     | Canceled                     |
| `subscription.cancel_reason`   | Canceled                     |

## Setting Up Subscription Emails

<Steps>
  <Step title="Open your merchant settings">
    Go to **Settings** → **Merchants** and click to edit your NMI or Stripe merchant.
  </Step>

  <Step title="Go to the Email tab">
    Switch to the **Email** tab. You'll see the standard order email section, plus two new sections: **Subscription Emails** and **Dunning Configuration**.
  </Step>

  <Step title="Create email templates">
    In the **Subscription Emails** section, click **Create** next to each template type. This generates a pre-built template you can customize in the email editor. Then select the template from the dropdown.
  </Step>

  <Step title="Configure dunning settings">
    In the **Dunning Configuration** section, set your retry schedule and escalation rules.
  </Step>
</Steps>

<Warning>
  Subscription emails require an **Email Integration** (Mailgun, Sendgrid, or Mailrelay) configured on the merchant. Without one, no emails will be sent.
</Warning>

<Note>
  The Subscription Emails and Dunning Configuration sections only appear for **NMI** and **Stripe** merchants, since those gateways can manage subscription billing inside ElasticFunnels.
</Note>

## Dunning Configuration

Dunning is the process of retrying failed subscription charges. When a renewal fails, the subscription enters a retry cycle according to your schedule.

| Setting                                 | Description                                    | Default                 |
| --------------------------------------- | ---------------------------------------------- | ----------------------- |
| **Max Retries**                         | Maximum retry attempts before auto-canceling   | 6                       |
| **Retry Schedule**                      | Day intervals between retries                  | 1, 3, 5, 7, 10, 14      |
| **Callcenter Escalation After Retry #** | Escalate to callcenter after this many retries | 3 (set to 0 to disable) |
| **Send to Callcenter on Cancel**        | Route cancellation events to callcenter        | Off                     |

<Info>
  The **Callcenter Escalation After Retry #** and **Send to Callcenter on Cancel** settings decide *whether* to send a call center event for that merchant. The integration controls *which* providers receive it, *when* they receive it, and *which* decline codes qualify. See [External Call Center Integrations](/integrations/callcenters) for the per-event configuration.
</Info>

### How the Retry Schedule Works

The retry schedule defines the number of days after the initial failure for each retry attempt. With the default schedule `1, 3, 5, 7, 10, 14`:

1. **Day 1** — First retry
2. **Day 3** — Second retry
3. **Day 5** — Third retry (callcenter escalation triggers here if configured at 3)
4. **Day 7** — Fourth retry
5. **Day 10** — Fifth retry
6. **Day 14** — Sixth and final retry

If all retries are exhausted, the subscription is automatically canceled.

<Tip>
  A healthy dunning recovery rate is 60–80%. If yours is below 50%, try adjusting your retry timing, ensure your renewal-failed emails have a clear "Update Payment Method" button, and consider enabling callcenter escalation.
</Tip>

## Pre-Renewal Reminders

Pre-renewal emails are sent automatically **3 days** before the next scheduled charge to customers with an active subscription and a valid email address.

<Info>
  Pre-renewal emails are recommended for legal compliance in some jurisdictions (e.g., FTC negative-option guidelines in the US).
</Info>

## Where Events Go

When a dunning event fires (renewal failed, cancel, winback), it's routed through three layers:

1. **Subscription emails** — the templates described above, sent to the customer directly.
2. **Merchant-level callcenter gate** — the **Callcenter Escalation After Retry #** / **Send to Callcenter on Cancel** settings decide if a call-center send is attempted.
3. **Per-integration event config** — each [external call-center integration](/integrations/callcenters) decides which events it actually receives, how long to wait before sending, and which decline codes to filter.

## Further reading

For detailed documentation on email template design, available variables, and editing, see the dedicated [Emails](/emails/overview) section:

* [Email Templates Overview](/emails/overview) — How to create and edit emails
* [Template Variables](/emails/template-variables) — Complete variable reference
* [Subscription Emails](/emails/subscription-emails) — Detailed guide for all subscription templates
* [Dunning](/emails/dunning) — Deep dive on dunning configuration and escalation
