Send monthly-usage-summary email to paid orgs for previous month
Aggregate previous month daily_usage per paid org, send digest.
Fires from pg_cron at 13:00 UTC on the 1st of each month (see 0025_monthly_usage_digest_cron.sql). Audience per PMO Q4 = basic + pro only; free-tier orgs excluded (low signal + template has tier_quota_monthly that free tier barely touches).
Month boundaries: previous-month (first day → last day inclusive). E.g. firing on 2026-05-01 aggregates 2026-04-01 → 2026-04-30. The 0-usage case still sends (calls_used=0) — the digest is the only recurring touchpoint for quiet orgs; silent skip would be invisible.
Idempotency: cron firing once per month + Resend message_id in log is sufficient dedup for V1. org_email_log backing lands in B-19-d and will cover the "cron fires twice on the 1st due to DST or manual trigger" case. Known limitation for launch.
Headers
Response
Successful Response