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

# How to Send Dunning Emails with Copilot and Gmail

> Use the AI Accounting Copilot and the Gmail MCP connector to draft a payment reminder for a past-due invoice, then batch the pass across your AR aging.

Use this guide when a customer invoice is past due and you want a reminder written from the live AR record, reviewed by a person, and sent from your own mailbox.

The workflow deliberately ends in a Gmail draft rather than a sent message. Copilot assembles the facts and the wording; you read it, adjust the tone, and press Send yourself. The Gmail connector can send as well as draft, so stopping at a draft is a choice this guide makes and asks you to keep, not a limit the connector imposes.

This is the ad hoc path, for the accounts where judgment matters. For a fixed cadence that fires on every overdue invoice with no human in the loop, configure [dunning sequences](../core-financials/accounts-receivable/invoicing-and-dunning#dunning-automated-payment-reminders) instead. The two coexist: sequences carry the routine volume, Copilot handles the ten accounts you actually want to think about.

## Before you start

This workflow assumes the Gmail connector is already connected for your organization and that you have a specific past-due invoice in hand. Both are worth confirming before you open Copilot, because a missing connector produces a silent failure rather than an error.

You need:

* An AR role that can read invoices and customer records. Copilot inherits your [role-based permissions](../platform-configuration/user-roles-and-permissions) and cannot surface an invoice you could not open yourself.
* The Gmail connector installed for your organization, which requires a Google Cloud OAuth web application client your organization owns and a role with the integrations permission. See [how to connect an MCP connector](./connect-an-mcp-connector).
* Your own Gmail account connected to it. Credentials are per-user, so an install your colleague authorized does nothing for you until you complete the authorization yourself.
* Gmail's draft tool set to **Enable** or **Opt-in** under **Interactive Tools** in the connector's **Permissions** section. Interactive tools start disabled, so Copilot can search your mail but produces no draft until that one tool is turned on. **Opt-in** is the safer setting here, since it puts a confirmation in front of every draft.
* A decision about Gmail's send tool, which is a separate permission from drafting. Leaving it **Disable** is what makes "draft only" hold for everyone using the connector. Set it to **Opt-in** rather than **Enable** if you want it available at all, so no message leaves the mailbox without a confirmation.
* The mailbox you authorize chosen deliberately. Drafts appear in your own mailbox, not a shared one, so authorize the AR or billing account your customers already recognize rather than a personal inbox.
* An approved, posted invoice that is genuinely past due. Confirm it in [AR aging](../reporting-analytics/aging-reports) first if you are not sure.
* Your organization's position on collections tone and any legal language required after 30 or 60 days. Copilot writes what you ask for, including things you would rather not put in writing.

## How the pieces fit together

Two systems combine in this workflow. DualEntry supplies the invoice facts because Copilot reads your ledger, and Gmail supplies the delivery surface because the connector can read, search, draft, and send messages in the mailbox you authorized. Neither one decides which customer to contact. That stays with you.

The sequence runs from the aging report to a message you send yourself. You identify a past-due invoice, Copilot reads the record from the general ledger, the Gmail connector turns it into a draft, the draft lands in the connected mailbox, and you review and send it. Every Copilot turn along the way is written to the audit trail.

Asking Copilot to send directly would collapse the last two steps, which is exactly the review this workflow is built around. Keep the send tool disabled, or set it to **Opt-in**, so a stale balance or a wrong recipient meets a person before it meets a customer.

```mermaid theme={null}
flowchart LR
    A[AR aging<br/>past-due invoice] --> B[Copilot<br/>reads the GL]
    B --> C[Gmail connector<br/>drafts the message]
    C --> D[Your Gmail<br/>drafts folder]
    D --> E[You review<br/>and send]
    B -.logged.-> F[Audit trail]
```

## Draft a reminder for one invoice

Drafting takes three steps: scope the conversation to the issuing entity, verify the invoice, then ask for the email. Do them in order, because each one gives you something to check the next against.

### Step 1: Scope the conversation to the right entity

In the Copilot composer, set the company selector from **All companies** to the entity that issued the invoice, and confirm the accounting basis selector reads **GAAP**.

Skipping this is the most common way these drafts go wrong. In a multi-entity org, an unscoped question can return a consolidated balance, and a reminder quoting a consolidated figure to a single-entity customer is a call you do not want to take.

### Step 2: Confirm the invoice in Copilot

Ask for the record before you ask for the email. A short verification turn gives you something to check the draft against.

```text theme={null}
For Acme Corp, list every open invoice past its due date as of today.
Show invoice number, invoice date, due date, days past due, original amount,
amount paid, and open balance.
```

Copilot returns a sortable table with the source records attached. Click through to at least one invoice and confirm three things: no payment landed after the aging snapshot, no open credit memo should be applied first, and the invoice is not in a dispute your sales team already knows about.

<Info>
  Asking these verification questions cannot change the invoice or the ledger, so they are always safe to repeat if you are unsure whether the aging snapshot has moved.
</Info>

### Step 3: Draft the email

Give Copilot the recipient, the record, the tone, and the ask. Naming the invoice explicitly keeps it from summarizing the whole relationship.

```text theme={null}
Draft a Gmail message to billing@acmecorp.com about invoice INV-1042.

Use the open balance and days past due from the record you just pulled.
Tone: polite first reminder, no late-fee language, no service-suspension threat.
Include the invoice number, invoice date, due date, and open balance.
Close by asking for a payment date or a point of contact if the invoice is in
review on their side.
Sign it from <your name>, Accounts Receivable.
Save it as a draft. Do not send it.
```

Copilot creates the draft in the mailbox you authorized and reports back what it wrote. If the wording is close but not right, iterate in the same thread rather than starting over. The sidebar panel keeps conversation history for the session, so follow-ups like "shorten it to four sentences and drop the apology" work against the draft it already has.

For a day-30 or day-60 escalation, say so directly and name the consequence you are willing to state. Copilot does not escalate on its own, and it should not.

## Review and send

Copilot's draft is a starting point, not a finished message. Reviewing it in Gmail and recording the contact in DualEntry are the two steps that make the reminder defensible later.

### Step 4: Review in Gmail, then send

Open the draft in Gmail and check:

* The recipient is the AP contact who pays, not the person who signed the contract.
* The open balance matches what you verified in Step 2, to the cent and to the currency.
* The invoice number appears in the subject line, so the customer can route it internally.
* Your remittance instructions and payment link are present. Copilot has your ledger, not your bank details, so add these yourself unless they are in a signature block.
* Nothing about other invoices, other entities, or internal notes leaked in.

Send from Gmail once it reads the way you would have written it. Sending by hand is a convention rather than a restriction: the connector holds send permission alongside drafting, so Copilot will send on your behalf if the send tool is enabled and you ask it to. The review step only holds because you keep it.

The DualEntry-generated invoice PDF is not attached automatically. If the customer needs the document rather than the numbers, either download it from the invoice record and attach it in Gmail, or skip this workflow and use **Send** on the invoice itself, which generates the PDF and tracks delivery.

### Step 5: Close the loop in DualEntry

Your Copilot prompts and responses are captured in the [audit trail](../platform-configuration/audit-trail-and-compliance) with a timestamp and the records referenced. The Gmail call is logged too, but only as metadata: the tool that ran, who ran it, and whether it succeeded. Neither the recipient nor the wording of the draft is stored.

The email itself lives in Gmail, so it does not appear in the invoice's own communication history the way a native dunning step would.

If your collections process depends on a complete per-invoice log, note the contact on the invoice record after sending. Auditors and whoever covers your desk next month both need it.

## Batch a full aging pass

Once the single-invoice version works, run the same shape across the aging report.

```text theme={null}
List every invoice more than 30 days past due for this entity, grouped by customer,
with total open balance per customer. Exclude customers with an open credit memo
and anything already flagged in dispute.
```

Review that list and remove the accounts you do not want touched, then draft against what remains:

```text theme={null}
For these customers, draft one Gmail message each to the billing contact on the
customer record. One email per customer covering all of their past-due invoices,
itemized by invoice number with a total at the bottom. Same tone as INV-1042.
Save all of them as drafts.
```

One email per customer, not one per invoice. A customer with six overdue invoices should get a single itemized message. Review every draft individually before sending. The batch step saves you the typing, not the reading.

If you run this monthly with the same wording, save the prompt as a Skill. Skills live under **Skills** in the Agents panel and run with `/` from the composer, so the next pass becomes one keystroke and the wording stays consistent across whoever is covering AR that week. DualEntry ships `/ar-aging-digest` for the list half of this workflow, which is a reasonable starting point to copy and narrow.

## Schedule the recurring version

To have the review waiting for you instead of remembering to ask:

1. In the Agents panel, select **Scheduled Agents**, then create a new agent.
2. Set the cadence. Weekly on Monday morning suits most collections rhythms, and daily is usually more than the aging data changes.
3. Use a prompt that produces the list, not the drafts. For example: list every invoice newly crossing 30 days past due since the last run, with customer, open balance, and days past due.
4. Set the entity scope explicitly. A scheduled agent has no one sitting at the composer to correct **All companies**.

Keep drafting and sending under human control. Nothing stops a scheduled agent from calling the Gmail draft tool, and nothing stops it calling the send tool either where that tool is enabled, which is exactly why the restraint has to be yours. An unattended run puts messages in a mailbox with nobody watching, and a draft sitting in Gmail for three weeks is worse than no reminder at all. A reminder sent from a schedule to the wrong customer is worse than both. Let the schedule tell you who needs chasing, then do Steps 2 through 4 for the accounts that warrant it.

Check on the agent occasionally. A scheduled agent stops itself after three consecutive failures and does not notify anyone, so a review you rely on can go quiet without telling you.

## Troubleshooting

Most failures in this workflow trace back to entity scope, connector authentication, or an aging snapshot that moved. The table below maps what you see to what to do about it.

| What you see                                     | What to do                                                                                                                                                                         |
| ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Gmail shows **0 tools available**                | You have not connected your own Gmail account. Installation is organization-wide, but credentials are per-user. See [how to connect an MCP connector](./connect-an-mcp-connector). |
| Copilot finds the invoice but produces no draft  | Gmail's draft tool is not enabled. Write tools are enabled one by one on the connector's organization settings, by someone with the integrations permission.                       |
| Copilot says it cannot find the invoice          | Either the invoice sits outside your permission scope or the entity selector is on the wrong company. Check the scope, then open the record directly to confirm access.            |
| Draft quotes a balance that does not match aging | A payment or credit memo posted after your aging snapshot. Re-run the Step 2 query and regenerate.                                                                                 |
| Copilot returns a consolidated figure            | The company selector is on **All companies**. Set the entity and ask again.                                                                                                        |
| Draft never appears in Gmail                     | Check which mailbox you authorized. Drafts land in the account you personally connected, which may not be the one open in your browser.                                            |
| Copilot declines to state a balance              | It does not guess. Missing or out-of-scope data produces a refusal rather than a number, which is the behavior you want on a customer-facing email.                                |

## Related reading

* [How the AI Accounting Copilot Works](./ai-accounting-copilot)
* [How to Connect an MCP Connector](./connect-an-mcp-connector)
* [Scheduled Agents Reference](./scheduled-agents)
* [Skills Reference](./skills)
* [How to Invoice Customers and Run Dunning](../core-financials/accounts-receivable/invoicing-and-dunning)
* [Aging Reports Reference](../reporting-analytics/aging-reports)
* [Customer Statements](../core-financials/accounts-receivable/customer-statements)
* [Audit Trail and Compliance](../platform-configuration/audit-trail-and-compliance)
