Automatically send polite payment reminders at 7, 14, and 30 days overdue — and escalate to you only when needed.
// Zapier Code step — pick the right reminder tone by days overdue
const days = Math.floor((Date.now() - new Date(inputData.dueDate).getTime()) / 86400000);
let tone = "friendly";
if (days >= 30) tone = "escalation";
else if (days >= 14) tone = "firm";
output = {
daysOverdue: days,
tone,
shouldSend: [7, 14, 30].includes(days),
};