Introducing the Chargebee CLI

Automations

Automations sends reminder emails based on the dunning rules you define. Create targeted rules for different customer or invoice segments, or enable the common rule that applies when no targeted rule matches.

To open Automations, go to Receivables > Automations.

Choose an offline or online reminder type

Automations has two reminder types. The type you choose controls when emails send:

  • Reminders - Offline Dunning — For invoices where Auto Collection is off (bank transfer, wire, and similar methods).
  • Reminders - Online Dunning — For invoices where Auto Collection is on (card, direct debit, SEPA, and similar methods).

To include During Dunning or During Payment Retry phases in a sequence, enable offline or online dunning in Configure Chargebee.

Understand targeted and common dunning rules

Each reminder type has two kinds of rules:

  • Targeted Dunning Rule — Applies when an invoice matches all conditions you set using exposed customer, invoice, and subscription fields. Target different segments by payment method, invoice amount, payment terms, business entity, and more.
  • Common Dunning Rule — Applies when no Targeted Dunning Rule matches. Enable and edit it so invoices that miss every targeted rule still get reminders. You cannot create a Common Dunning Rule; each reminder type already has one.

Once a dunning rule goes live, all newly generated invoices are matched against it. An invoice is matched to the first matching dunning rule, and reminders from that rule are sent. If no targeted rule matches, the Common Dunning Rule applies (if enabled). To reorder targeted rules, drag the handles on the list. The Common Dunning Rule stays separate.

Create a dunning rule

Create a targeted dunning rule for a specific invoice segment:

  1. Go to Receivables > Automations.
  2. Click Reminders - Offline Dunning or Reminders - Online Dunning.
  3. Click + Add Dunning Rule to create a Targeted Dunning Rule. The Common Dunning Rule already exists for each reminder type — open it from the list to edit it.
  4. Click the edit icon next to New Dunning Rule to name the rule.
  5. Complete Conditions, Reminder Sequence, and Settings.
  6. Click Publish. The rule appears on the list in an inactive state.
  7. Turn the toggle on from the Reminders page to activate the rule.

Understand draft and published versions

Dunning rules use draft and published versions. As you create or edit a rule, changes auto-save as a draft. Drafts don't send emails and can't be activated until published.

Never-published rules appear under Drafts. Published rules appear under Targeted Dunning Rules or Common Dunning Rule. When you edit a published rule, a new draft is created while the published version continues running. Click Publish to make your draft changes live, or click Discard Draft to abandon unpublished changes and restore the published version.

Set conditions for a dunning rule

Conditions decide which invoices the rule covers. Chargebee pre-fills these rows based on reminder type. Each row has a field, an operator, and a value. You can change those values, remove a row, or click + Add Condition.

Reminder typeFieldOperatorValue
Reminders - Offline DunningAuto CollectionisOff
Reminders - Online DunningAuto CollectionisOn
BothInvoice StatusincludesPosted, Payment Due, Not Paid

Click + Add Condition to choose from exposed customer, invoice, or subscription fields (for example, Subscription Status, MRR, Total Amount, or Customer Since), including custom fields configured for each.

Build the reminder sequence

The reminder sequence is the email timeline for your rule. Each phase shows when emails send relative to the invoice due date and payment events. Click + Add Email to add steps to any phase. Every dunning rule requires at least one reminder email in the sequence.

Offline dunning phases

Offline dunning offers these phases. During Dunning appears only if offline dunning is enabled in Configure Chargebee.

PhaseDescription
Before Due DateSend early reminders before the invoice becomes due.
Due DateAn email is automatically scheduled on the invoice due date. Included by default in every Offline Dunning rule.
During DunningSend follow-up reminders after the due date while the dunning period is active.
After DunningSend final notices after the offline dunning period ends.

Online dunning phases

Online dunning offers these phases. During Payment Retry appears only if online dunning is enabled in Configure Chargebee.

PhaseDescription
Before Due DateOptional reminders before the invoice due date.
Due DateTriggered on the first payment failure on the due date. A default email is included.
During Payment RetrySend reminders while Chargebee is retrying the charge.
After Retries ExhaustSend a final email after all retries have failed.

If dunning is disabled, the timeline shows an After Due Date group instead of the During and After Dunning phases (for offline) or During Payment Retry and After Retries Exhaust phases (for online).

If you change dunning settings after you build a sequence, affected steps can show a Conflict warning. Click Resolve to update them.

Configure an email in the sequence

Each reminder in the sequence is an email you can customize before it sends. Within a phase, each email step includes:

  • Send email <> days before due date — Set how many days before the due date to send the email.
  • From — Sender address from the addresses already set up in Chargebee. Use Manage from addresses to add or change senders.
  • Send to — Defaults to the customer's primary email contact. You can also send to account contacts, billing contacts, or billing email. Use additional recipients, CC, and BCC to copy other addresses.
  • Language — One tab per available language. Chargebee uses the customer's configured language when a translation exists; otherwise it uses the default language.
  • Subject and Body — Edit the template. Use template variables to insert live customer and invoice data at send time.
  • Advanced Settings has two toggles:
    • Attach the invoice PDF — Adds a PDF copy of the invoice to the reminder email.
    • Attach a usage summary PDF — Adds a PDF of the customer's usage summary to the reminder email.

The branding in your Chargebee settings is automatically used in these email templates.

Template variables are grouped into these categories:

Variable categoryDescription
CustomerCustomer-level information such as name, reference ID, and outstanding amounts.
InvoiceInvoice-level details such as invoice number, amount, due date, and payment method.
PaymentPayment attempt details such as failure reason, charge date, and retry status.
MerchantYour company name and contact details.
Client PortalLinks to the self-serve Customer Portal and Pay Now page.

Portal-related blocks in the email body may not render when the Customer Portal is disabled for your site.

To preview how the email looks before publishing, click the ellipsis icon and click Test. Test emails do not enroll customers in the live sequence.

Configure delivery settings

Choose a send-time window for reminder emails. These settings apply to every email in the sequence.

OptionDescription
System Timing - DefaultChargebee sends based on queues and load, starting at 09:00.
07:00 – 09:00 (Morning)Sends during the morning window.
14:00 – 15:00 (Midday)Sends during the midday window.
CustomSet your own time window.

The email delivery time window is applied according to the timezone selected in your Chargebee site.

When you finish configuring the rule, you can Clone it, Delete it, Close the rule creation wizard, or Publish the rule.

Manage dunning rules

From the Automations rule list, enable, edit, clone, delete, or reorder published rules.

ActionHow
Mark as Active or InactiveUse the toggle next to the rule.
EditClick the pencil icon to change conditions, sequence, or settings.
CloneCreates a copy named Copy of the original title. It starts as a draft — publish and enable it separately.
DeletePermanently removes the rule. Turn the rule off first.
ReorderDrag Targeted Dunning Rules to change evaluation order. The Common Dunning Rule is not in that stack.

Limitations

  • Reminders are not sent during the dunning period for invoices with payment schedules.