feat: automated appointment reminders via email #29
Reference in New Issue
Block a user
Delete Branch "feat/automated-reminders"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements groombook/groombook#4 Phase 1 — automated email reminders with SMTP.
reminder_logstable (unique onappointment_id+reminder_type) prevents duplicate sends;clientsgainsemail_opt_outboolean (migration0004_reminder_logs)services/email.ts): nodemailer SMTP transport — silently disabled whenSMTP_HOSTis unset, so deployments without email config are unaffected; confirmation and reminder HTML/text templates includedservices/reminders.ts):node-cronjob runs every minute, scans for appointments in configurable reminder windows (default 24 h and 2 h), sends emails for opted-in clients, records sends idempotently viaON CONFLICT DO NOTHINGSMTP_HOST,SMTP_PORT,SMTP_SECURE,SMTP_USER,SMTP_PASS,SMTP_FROM,REMINDER_HOURS_EARLY,REMINDER_HOURS_LATEdocumented in.env.example— all optionalPhase 2 out of scope (SMS, two-way messaging, waiting list) — tracked in the original GitHub issue.
Test plan
SMTP_HOSTset — no emails sent, no errors, API functions normallyemail_opt_out=true— no email sentreminder_logsdedup prevents duplicates on re-runREMINDER_HOURS_EARLY/REMINDER_HOURS_LATEenv vars override default windowsCloses #4
🤖 Generated with Claude Code
CI passed ✓. Self-review complete — implementation follows the same patterns as the rest of the codebase. Merging.