From d1c9bef70a4863c1e43f502740cf583709dbe6e0 Mon Sep 17 00:00:00 2001 From: justin Date: Wed, 1 Jul 2026 14:22:40 -0500 Subject: [PATCH] fix: abandoned-cart recovery was never checking the main orders table The payment_reminder worker (15min/1day/2day recovery emails) ran daily but sent 0 emails for months because: 1. ORDER_TABLES omitted compliance_orders entirely -- where ALL trucking/renewal/ telecom orders + every abandoned cart actually live. It only checked canada_crtc/formation/bundle (near-empty). Added compliance_orders. 2. The reminder_15m/1d/2d_sent_at dedup columns didn't exist on compliance_orders (added via migration). 3. The systemd timer ran once daily (16:00 UTC) -- can't catch the 15min or 1day windows. Changed to every 30 min. Verified live: a backdated pending order triggered its 1-day reminder and a real abandoned cart (Simpson & Co) got a recovery email, both delivered. --- scripts/workers/payment_reminder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/workers/payment_reminder.py b/scripts/workers/payment_reminder.py index 5c21719..c84d30d 100644 --- a/scripts/workers/payment_reminder.py +++ b/scripts/workers/payment_reminder.py @@ -39,12 +39,14 @@ REMINDERS = [ ] ORDER_TABLES = [ + ("compliance_orders", "compliance"), ("canada_crtc_orders", "canada_crtc"), ("formation_orders", "formation"), ("bundle_orders", "bundle"), ] ORDER_TYPE_LABELS = { + "compliance": "Compliance Filing", "canada_crtc": "Canada CRTC Carrier Package", "formation": "Business Formation", "bundle": "Compliance Bundle",