On a schedule
Send polite Gmail reminders for overdue QuickBooks invoices
Every weekday, customers with overdue QuickBooks invoices get a reminder from your Gmail address, firmer as the invoice ages, and you get a summary.
- Runs
- On a schedule
- Apps
- Gmail, QuickBooks
- AI
- Yes, uses the built-in AI allowance
- Access
- QBO read; Gmail send
Send this to your assistant
Create a ClickRuntime automation: each weekday at 9am, find QuickBooks invoices past due with a balance, send the customer a Gmail reminder with a tone that matches how late it is, at most once a week per invoice, and email me a summary.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Reminders from an accounting system feel automated and get ignored. A short personal email from the owner's address gets read and answered. But writing those emails by hand, every week, for every late customer, rarely happens.
Sending reminders from your own Gmail, worded to match how late the invoice is, gets the response rate of a personal email with none of the effort.
What you get out of it
Reminders that get answered
An email from a real person's address gets more replies than a system notification.
The right tone at the right time
A friendly nudge at a few days late, a firmer note at a month, chosen by how overdue the invoice is.
Replies land in your inbox
Questions and payment promises come straight back to you.
Weekly, not daily
Each invoice is chased at most once a week, so customers don't feel harassed.
How it works
What happens, step by step
Each weekday at 9am, ClickRuntime asks QuickBooks for invoices with a balance that are past due.
It skips invoices it reminded about in the last 7 days.
AI writes a short reminder with a tone that matches how many days late the invoice is.
The reminder is sent to the customer from your Gmail address.
You get an email summary of everyone reminded.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Connect QuickBooks
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Change what the AI looks for, or how it writes the result
- Add another app, for example also send it to Slack
- Combine it with other Gmail and QuickBooks steps into one automation
Under the hood
The code that runs this automation
import base64
from datetime import date
from email.message import EmailMessage
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, notify, ai
API = "https://quickbooks.api.intuit.com/v3/company/1234567890" # your QuickBooks company id
def qb(method, path, **kw):
r = http.request(method, API + path, params={"minorversion": 73, **kw.pop("params", {})}, **kw, headers={"Accept": "application/json", "Authorization": "Bearer " + credentials.connection("quickbooks", "company")})
return r.raise_for_status() or r.json()
@on_trigger
def run(event):
today = date.today()
invoices = qb("GET", "/query", params={"query": f"select * from Invoice where Balance > '0' and DueDate < '{today}'"})["QueryResponse"].get("Invoice", [])
last = state.get("last") or {}
gmail, sent = build("gmail", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False), []
for inv in invoices:
days = (today - date.fromisoformat(inv["DueDate"])).days
if not inv.get("BillEmail") or (today - date.fromisoformat(last.get(inv["Id"], "2000-01-01"))).days < 7:
continue
tone = "friendly" if days < 14 else "neutral" if days < 30 else "firm but polite"
facts = f"Invoice {inv['DocNumber']} for ${inv['Balance']:,.2f} was due {inv['DueDate']} ({days} days ago)."
try:
body = ai.generate(f"Write a short {tone} payment reminder email body to {inv['CustomerRef']['name']}. {facts}", max_output_tokens=200).text
except ai.AIError:
body = f"Hello,\n\nA quick reminder: {facts} Please let us know when we can expect payment.\n\nThanks"
msg = EmailMessage()
msg["To"], msg["Subject"] = inv["BillEmail"]["Address"], f"Reminder: invoice {inv['DocNumber']}"
msg.set_content(body)
gmail.users().messages().send(userId="me", body={"raw": base64.urlsafe_b64encode(msg.as_bytes()).decode()}).execute()
last[inv["Id"]] = str(today)
sent.append(f"{inv['CustomerRef']['name']} #{inv['DocNumber']}: ${inv['Balance']:,.2f}, {days} days")
if sent:
notify.email_me(f"Sent {len(sent)} payment reminders", "\n".join(sent))
state.set("last", last)
return {"reminded": len(sent)}FAQ
Common questions
How is the tone chosen?
What if AI isn't available?
Which customers are skipped?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Turn emailed supplier invoices into QuickBooks bills
When a supplier emails a PDF invoice, a bill is created in QuickBooks with the PDF attached, and you get an email listing what was added.
See how it worksCreate QuickBooks invoices from emails you label
Label an email thread Invoice Needed and a QuickBooks invoice for the client and items it mentions is created and sent.
See how it worksGet a daily news digest in Slack
Each morning your team gets a short summary of what's new on the sites and blogs you follow.
See how it worksKeep exploring
Set up “Send polite Gmail reminders for overdue QuickBooks invoices” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.