You know the feeling: a client's payment was due last Friday, and you remembered it on Tuesday — after you'd already spent the weekend annoyed at them for something that was your own bookkeeping problem. The fix isn't a better memory. It's a pipeline that looks at your contract dates every morning and sends the reminder for you, then writes down that it did.
By the end of one evening you'll have exactly that: a spreadsheet holding contract terms, a daily job that reads it, an email that goes out on the right day, and a log column that proves each send happened. You'll know it works because you'll test it on three fake rows before it ever touches a real client.
What you actually get, and how you'll see it working
The end state is small and boring, which is the point:
- One sheet: one row per contract, with the amount, the due date, and the day you want to be reminded.
- A daily run at a fixed hour that finds rows whose reminder date has arrived and that haven't been sent yet.
- An email per row to the person who needs it (you, an accountant, the client — your choice), with the contract name and amount filled in.
- A Sent at column and a Message ID column in the sheet, filled in after each send.
You'll see it working the first morning the Sent at column fills itself and the mail lands in your inbox. From then on, the sheet is the source of truth, not your head.
Step 1: Design the sheet so the script can trust it
Most of these projects die here, not in the code. If the sheet has merged cells, dates typed as text, or a "status" written as "paid-ish", the script will send the wrong reminder at the wrong time, and you'll stop trusting it. More on the topic: “Deadline reminders from your own database: how to build a service that emails a templated attachment N days before renewal and never lets you forget”.
Use one flat table, one header row, no merges. Minimum columns:
| Column | Example | Why it exists |
|---|---|---|
| Contract | Acme — retainer Q1 | Human-readable label |
| Client email | billing@acme.example | Where the reminder goes |
| Amount | 4200 | Shown in the email |
| Currency | USD | So the amount is unambiguous |
| Due date | 2026-12-15 | The real deadline |
| Remind days before | 5 | Offset for the reminder |
| Status | open / paid / cancelled | Rows not open are skipped |
| Sent at | (empty) | Written by the script |
| Message ID | (empty) | Written by the script |
Two decisions are yours, not the AI's:
- Date format. Pick ISO (
2026-12-15) and set the column format to plain text or a real date type — never mix. A row with15.12.2026will be read as text and silently skipped. - Status vocabulary. Three values only:
open,paid,cancelled. Anything else is a bug.
Owner: you design the columns and enforce the vocabulary. AI can generate the sheet template and a validation check that flags rows with unparseable dates.
Step 2: Write the reminder-date rule before any code
This is the part people skip, and it's the part that decides whether the emails are useful or annoying. The reminder date isn't the due date — it's the due date minus the offset, adjusted for weekends.
A rule that works for most small contracts:
- Reminder date = due date −
Remind days before. - If that lands on a Saturday or Sunday, move it to the preceding Friday.
- If the reminder date is already in the past when you add the row (a contract added late), send on the next run rather than skipping it.
Write this as three sentences in a comment above the script. The AI will implement whatever you describe; if you describe it vaguely, it will invent a rule and you'll only notice when a client gets a reminder a week early.
Step 3: Build the daily job
The script does four things in order: read the sheet, filter, send, write back. Keep it in that order — the write-back is what prevents duplicate sends later.
- Read all rows from the sheet via the Google Sheets API (or your spreadsheet tool's API — check its docs for the exact method to read a range).
- Filter to rows where
Status == open,Sent atis empty, and the computed reminder date is today or earlier. - Send one email per row through your mail provider's API (SendGrid, Postmark, Amazon SES, Gmail API — whichever you already have an account with).
- Write back the send timestamp and the provider's message ID into that row.
Owner split: the AI writes the script and the sheet-read/send/write-back functions. You supply the field names from the API docs — don't let the AI guess them. If you're unsure of a parameter name, open the provider's reference and paste the relevant section into the prompt.
Schedule it with whatever you already run: a cron entry on a small server, a scheduled cloud function, or the built-in trigger of your automation tool. Once a day at a fixed hour (08:00 local) is enough; running it hourly doesn't make reminders better, it just multiplies the damage if deduplication is broken.
Step 4: Write the email so it doesn't read like a robot
A reminder that says "This is an automated notification" gets ignored. Keep it short and specific: More on the topic: “AI for Professionals: Automating Your Own Work End to End — Why Your Automations Break Silently and How to Catch It”.
- Subject:
Payment due 15 Dec — Acme retainer Q1 - Body: one line naming the contract and amount, one line with the due date, one line with how to pay, and a signature.
Template with placeholders the script fills from the row:
Subject: Payment due {{due_date}} — {{contract}}
Hi,
A reminder that {{contract}} ({{amount}} {{currency}}) is due on {{due_date}}.
Payment details are in the contract. Reply here if anything has changed.
— Your name
Owner: you write the template. The AI fills in the placeholders and handles escaping. Read the first real email yourself before it goes to a client — automated mail has a way of producing "Hi {{client_name}}" exactly once, and that once is always to your most important account. More on the topic: “AI for Professionals: Automating Your Own Work End to End — An Advanced Program for Professionals Who Want to Stop "Trying ChatGPT" and Start Saving Hours”.
Step 5: Stop duplicate sends before they happen
The single failure that will make you abandon the project: a client gets the same reminder three days in a row because the write-back failed or the scheduler fired twice.
Three layers, cheapest first:
- Write-back as a lock. The script writes
Sent atimmediately after a successful send. On the next run, rows withSent atfilled are skipped. This alone handles 95% of cases. - Check the message ID. If the mail provider returned an ID, the send succeeded — don't retry it. Only retry on an explicit error.
- Idempotency key. Many mail APIs accept an idempotency key per request (check your provider's docs — the parameter name varies). Use
contract + due_dateas the key so a double-fire of the scheduler can't send twice.
What access you need, and where it gets stuck
| Access | Where to get it | What breaks without it |
|---|---|---|
| Spreadsheet read/write | Create a service account in your cloud console, share the sheet with its email, enable the Sheets API | Script can read but can't log sends → duplicates |
| Mail send | API key from your mail provider (SendGrid, Postmark, SES, Gmail API) | Nothing sends |
| Scheduler | Cron, cloud scheduler, or your automation tool | Nothing runs daily |
| Verified sender domain | DNS records (SPF/DKIM) at your domain registrar | Emails land in spam and you never notice |
The last row is the one people forget. If your domain isn't verified with the mail provider, your reminders go to spam folders and the pipeline "works" while doing nothing. Verify the domain and send one test email to an address you don't control (a personal Gmail works) before going live.
When access is impossible: if your client's contracts live in a system with no API (an old accounting tool, a PDF archive), don't try to scrape it. Keep the sheet as the manual entry point — someone types the row when a contract is signed. That's a five-minute weekly task and it's honest.
Three places this breaks, and what to do
1. The sheet gets edited mid-run. Someone marks a contract paid while the script is reading. The row gets a reminder anyway. Fix: read all rows at the start, filter in memory, and treat the Status check as advisory — a wrong reminder to a paid client is embarrassing but recoverable; a missed one costs money. If you want to be strict, re-read the row's status right before sending.
2. The scheduler silently stops. A cloud function's credentials expire, a cron server reboots. You won't notice until a client calls. Fix: have the script write a heartbeat — a row in a runs tab with the timestamp of each run. If the last heartbeat is more than 36 hours old, something is wrong. Check it once a week, or add a second job that emails you when the heartbeat goes stale.
3. Personal data in the sheet. Client emails and amounts are personal and commercial data. If the sheet is shared with the wrong link, or the service account key is committed to a repo, that's a breach. Fix: keep the key out of version control, share the sheet only with the service account and named people, and check your obligations under the data protection law that applies to you.
How to verify it by hand before it touches a real client
Don't trust "it ran without errors." Run these four checks:
- Date math. Add a test row with a due date on a Monday and offset 1. The reminder should fire the previous Friday. Success sign: the computed date in a debug print matches what you'd write on a calendar.
- Send once. Run the script. Success sign: one email arrives,
Sent atandMessage IDfill in the sheet. - Send twice. Run it again immediately. Success sign: no second email, no new write-back.
- Past-due row. Add a row whose reminder date was last week. Success sign: it sends on the next run, not never.
Only after all four pass do you paste in your real contracts. Add them five at a time and watch the first morning's output.
What it costs in time and money
Time: one evening for the sheet, the rule, and the script if you're comfortable with an AI agent and a terminal. Add an hour if you've never set up a service account or verified a domain. The debugging that eats time is almost always the date format and the deduplication, not the sending.
Money: the order of magnitude is small. Spreadsheet API access is free within normal quotas. Mail providers typically have a free tier for a few hundred emails a month and charge per thousand after that — check your provider's current pricing page, since tiers change. A scheduler on a small server or a cloud function's free tier usually covers a daily run. The real cost is the hour of your attention when a client asks why they got a reminder for a contract they paid last week.
If you'd rather not build it yourself, asibiont.com takes projects like this turnkey — the developer names the price, you top up the balance, and you get the working pipeline back.
The pipeline isn't clever, and that's why it will still be running in a year. The value isn't the code — it's that the next time a payment slips, it's because the client was late, not because you forgot. Build it once, check it on test rows, and let the sheet hold the dates from now on. asibiont.com