AI tracks overdue invoices and drafts professional follow-ups with attached invoices. Your finance team reviews before sending.
Accounts receivable teams spend hours manually tracking overdue invoices and sending follow-up emails. The follow-up cadence is inconsistent — some invoices get chased aggressively while others fall through the cracks. When follow-ups are sent, they're often missing the invoice attachment or key details, requiring additional back-and-forth with the client.
MultiMail's AI agent monitors your accounts receivable and drafts professional follow-up emails for overdue invoices. Each follow-up includes the original invoice, payment instructions, and messaging that escalates progressively. Gated_send oversight lets your finance team review messaging that could affect client relationships before delivery.
Your AI agent monitors your billing system for invoices that pass their due date without payment. It calculates days overdue and selects the appropriate follow-up tier.
The agent reviews the client's payment history using search_contacts to determine if this is a first-time issue or a pattern, adjusting the follow-up tone accordingly.
The agent composes a professional follow-up email, attaches the original invoice, and includes clear payment instructions and direct payment links.
Under gated_send, the follow-up enters the approval queue. Your finance team verifies the details and approves delivery, maintaining control over client communications.
import requests
from datetime import datetime
API = "https://api.multimail.dev/v1"
HEADERS = {"Authorization": "Bearer mm_live_xxx"}
def process_overdue_invoices(invoices: list):
today = datetime.utcnow().date()
for inv in invoices:
if inv["status"] == "paid":
continue
days_overdue = (today - inv["due_date"]).days
if days_overdue <= 0:
continue
"cm"># Check client payment history
contact = requests.get(
f"{API}/contacts/search",
headers=HEADERS,
params={"email": inv["contact_email"]}
).json()
tone = select_tone(days_overdue, contact)
body = draft_follow_up(inv, tone, days_overdue)
requests.post(
f"{API}/send",
headers=HEADERS,
json={
"from": "[email protected]",
"to": inv["contact_email"],
"subject": f"Invoice "cm">#{inv['number']} is {days_overdue} days past due - ${inv['amount']:,.2f}",
"text_body": body,
"html_body": build_follow_up_html(inv, tone)
}
)Identify overdue invoices and draft appropriate follow-up emails.
def select_tone(days_overdue: int, contact: dict) -> str:
has_good_history = contact.get("metadata", {}).get(
"on_time_rate", 1.0
) > 0.8
if days_overdue <= 7:
return "gentle" if has_good_history else "firm"
elif days_overdue <= 15:
return "firm"
elif days_overdue <= 30:
return "urgent"
else:
return "final"
def draft_follow_up(inv: dict, tone: str, days: int) -> str:
templates = {
"gentle": (
f"Hi {inv[&"cm">#039;contact_name']},\n\n"
f"I hope this finds you well. I wanted to follow up on "
f"invoice "cm">#{inv['number']} for ${inv['amount']:,.2f}, which "
f"was due on {inv[&"cm">#039;due_date']}. Please let us know if you "
f"need anything to process the payment.\n\n"
f"Payment link: {inv[&"cm">#039;payment_url']}"
),
"urgent": (
f"Dear {inv[&"cm">#039;contact_name']},\n\n"
f"Invoice "cm">#{inv['number']} for ${inv['amount']:,.2f} is now "
f"{days} days past due. We kindly request immediate payment "
f"to avoid any impact to your account.\n\n"
f"Payment link: {inv[&"cm">#039;payment_url']}\n\n"
f"If there are any issues with this invoice, please reply "
f"so we can resolve them promptly."
)
}
return templates.get(tone, templates["gentle"])Select tone and content based on days overdue and payment history.
"cm">// Using MultiMail MCP tools for invoice follow-up
async function followUpOverdueInvoice(invoice: Invoice) {
const daysOverdue = daysBetween(invoice.dueDate, new Date());
if (daysOverdue <= 0) return;
"cm">// Check client payment history
const contacts = await mcp.search_contacts({
query: invoice.contactEmail
});
const tone = selectTone(daysOverdue, contacts[0]);
"cm">// Send follow-up (queued for finance review)
await mcp.send_email({
to: invoice.contactEmail,
subject: `Invoice #${invoice.number} is ${daysOverdue} days past due`,
text_body: draftFollowUp(invoice, tone, daysOverdue)
});
"cm">// Tag for tracking
await mcp.add_contact({
email: invoice.contactEmail,
metadata: {
last_followup_date: new Date().toISOString(),
followup_count: (contacts[0]?.metadata?.followup_count || 0) + 1
}
});
}Manage invoice follow-ups using MultiMail MCP tools.
Every overdue invoice gets followed up on schedule. No more invoices falling through the cracks because someone was on vacation or too busy.
The AI adjusts tone based on payment history and relationship length. Long-standing clients with good track records get gentler reminders than chronically late payers.
Every follow-up includes the original invoice, payment instructions, and a direct payment link. Clients never have to ask for the invoice to be resent.
Gated send keeps your finance team in control of client communications. They review tone and content before delivery, preventing messages that could damage relationships.
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 38-tool MCP server. Formally verified in Lean 4.