> ## 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.

# Send Dunning Emails with Accounting Intelligence and Gmail

> Use Accounting Intelligence 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. Accounting Intelligence assembles the facts and the wording; you read it, adjust the tone, and choose 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 DualEntry sends on unpaid invoices, configure [AR Dunning](https://docs.dualentry.com/accountants/core-financials/accounts-receivable/ar-dunning.md) instead. The two coexist: AR Dunning carries the routine volume, and Accounting Intelligence handles the 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 Accounting Intelligence, because a missing connector produces a silent failure rather than an error.

You need:

* An AR role that can read invoices and customer records. Accounting Intelligence inherits your [role-based permissions](https://docs.dualentry.com/accountants/platform-configuration/user-roles-and-permissions.md) and cannot surface an invoice you could not open yourself.
* The Gmail connector installed for your organization. Installing it requires a Google Cloud OAuth web application client your organization owns, and the Admin, IT, or HR role or a custom role that can create integrations. See [how to connect an MCP connector](https://docs.dualentry.com/accountants/ai-automation/accounting-intelligence/connect-an-mcp-connector.md).
* 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 not set to **Blocked** under **Interactive Tools** on your connection. Interactive tools start at **Needs approval**, so by default Accounting Intelligence asks you to approve each draft in the conversation before it creates it.
* A decision about Gmail's send tool, which is a separate permission from drafting. Setting it to **Blocked** is what makes "draft only" hold for you. Tool permissions are per user, so each colleague who connects Gmail makes this choice for themselves. At **Needs approval**, every send waits for you to approve it. At **Always allow**, Accounting Intelligence sends on your behalf whenever you ask it to, with no approval step.
* 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](https://docs.dualentry.com/accountants/reporting-analytics/aging-reports.md) first if you are not sure.
* Your organization's position on collections tone and any legal language required after 30 or 60 days. Accounting Intelligence 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 Accounting Intelligence 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, Accounting Intelligence 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 Accounting Intelligence turn along the way is written to the audit trail.

Asking Accounting Intelligence to send directly would collapse the last two steps, which is exactly the review this workflow is built around. Keep the send tool set to **Blocked**, 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[Accounting Intelligence<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 Accounting Intelligence 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 Accounting Intelligence

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.
```

Accounting Intelligence returns a sortable table with the source records attached. Choose 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.

> [!NOTE]
>
> 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.

### Step 3: Draft the email

Give Accounting Intelligence 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.
```

With the draft tool at **Needs approval**, the default, an approval card appears in the conversation before the draft is created. Check the recipient and invoice in the card, then choose **Approve Once**.

Accounting Intelligence 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. Accounting Intelligence does not escalate on its own, and it should not.

## Review and send

Accounting Intelligence'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. Accounting Intelligence 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, because the connector holds send permission alongside drafting. If the send tool is not **Blocked** and you ask Accounting Intelligence to send, it sends on your behalf. The review step only holds because you keep it.

DualEntry does not attach the generated invoice PDF 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 Accounting Intelligence prompts and responses are captured in the [audit trail](https://docs.dualentry.com/accountants/platform-configuration/audit-trail-and-compliance.md) 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 [AR Dunning](https://docs.dualentry.com/accountants/core-financials/accounts-receivable/ar-dunning.md) reminder log the way a native reminder does.

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.
```

With the draft tool at **Needs approval**, each draft in the batch has its own approval card. Approve them one at a time as they appear.

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, choose **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. Name the entity in the prompt. There is no entity field on the agent. An instruction that names no company runs across every company the owner can reach, with no one sitting at the composer to notice a consolidated figure.

Each run gets its own chat, listed in the agent's drawer. Open the agent from **Scheduled** in the Agents panel when its entry reads **Ready to view**, and pick the run from the runs list. Runs are private to the agent's owner, so the person doing the chasing should be the person who creates the agent.

Drafting and sending stay with a person here, and on a schedule that is enforced rather than left to your restraint. An unattended run receives only a connector's read-only tools, so a scheduled agent can search the authorized mailbox but cannot draft in it or send from it, whatever Gmail's interactive tools are set to. Write the prompt accordingly: an instruction that asks the schedule to draft the reminders produces a report about them instead. 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. Before you rely on one, see [how to test a scheduled agent](https://docs.dualentry.com/accountants/ai-automation/accounting-intelligence/how-to-test-a-scheduled-agent.md).

## 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](https://docs.dualentry.com/accountants/ai-automation/accounting-intelligence/connect-an-mcp-connector.md). |
| Accounting Intelligence finds the invoice but produces no draft | Gmail's draft tool is **Blocked**, or you rejected the approval card. If its buttons in the connector's details are available, set it to **Needs approval** or **Always allow**, then ask again. If the buttons are unavailable, ask an admin to remove the organization-wide block. |
| Accounting Intelligence 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. |
| Accounting Intelligence 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. |
| Accounting Intelligence 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 Accounting Intelligence Works](https://docs.dualentry.com/accountants/ai-automation/accounting-intelligence/ai-accounting-intelligence.md)
* [How to Connect an MCP Connector](https://docs.dualentry.com/accountants/ai-automation/accounting-intelligence/connect-an-mcp-connector.md)
* [Scheduled Agents Reference](https://docs.dualentry.com/accountants/ai-automation/accounting-intelligence/scheduled-agents.md)
* [Skills Reference](https://docs.dualentry.com/accountants/ai-automation/accounting-intelligence/skills.md)
* [How to Configure AR Dunning](https://docs.dualentry.com/accountants/core-financials/accounts-receivable/ar-dunning.md)
* [How to Invoice Customers and Run Dunning](https://docs.dualentry.com/accountants/core-financials/accounts-receivable/invoicing-and-dunning.md)
* [Aging Reports Reference](https://docs.dualentry.com/accountants/reporting-analytics/aging-reports.md)
* [Customer Statements](https://docs.dualentry.com/accountants/core-financials/accounts-receivable/customer-statements.md)
* [Audit Trail and Compliance](https://docs.dualentry.com/accountants/platform-configuration/audit-trail-and-compliance.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.