I Automated the Late Payment Follow-Up (Here's the Script)
If you've been freelancing for more than a month, you've lived this: invoice sent, due date passed, radio silence. The follow-up email is easy to write once. It's annoying to write on a schedule, f...

Source: DEV Community
If you've been freelancing for more than a month, you've lived this: invoice sent, due date passed, radio silence. The follow-up email is easy to write once. It's annoying to write on a schedule, for every client, consistently. So most people don't — and late payments drag on. I automated it. What the script does It reads a CSV of your invoices (client name, amount, due date, email, status). Once a day, it checks for overdue invoices and sends the right email for the right stage: Day 1 overdue: friendly nudge, warm tone Day 7: direct ask, invoice re-attached Day 14: firmer, references previous emails Day 30: final notice before escalation You set the templates once. The script handles the cadence. # invoice_followup.py — core logic import csv, smtplib, datetime from email.mime.text import MIMEText STAGES = [ (1, "just checking in", "warm"), (7, "following up again", "direct"), (14, "third notice", "firm"), (30, "final notice", "formal"), ] def days_overdue(due_date_str): due = datetime