Repository navigation
Description
Found while wiring up Resend (#431). Setting a mail API key does not make notification email work, because nothing that sends it is deployed.
Evidence
The repo defines 26 edge functions. Production runs 6:
trpc, job-import, news, news-import, email-inbound-parse, api
notify-send-worker is the only function that calls getAdapter(channel).send(...) — i.e. the only thing that actually dispatches a notification to email, push or SMS. It is not deployed. Neither is anything else in the chain:
| Function | Deployed | Role |
|---|---|---|
notify-send-worker |
❌ | drains core.notification_deliveries and sends |
notify-publish |
❌ | fans a notification out to channels |
notify-digest-daily / notify-digest-weekly |
❌ | digest email |
notify-background-check-expiration |
❌ | 30/7-day reminders |
notify-id-verification-expiration |
❌ | expiry reminders |
notify-check-receipts |
❌ | receipts |
send-team-invitation |
❌ | invitation email |
webhooks (incl. webhooks/email) |
❌ | delivery status callbacks |
Consistent with the data: core.notification_deliveries in production is completely empty — zero rows, no statuses, no history. Nothing has ever been queued or sent.
The deployed api function's notifications route only reads and writes notification rows; it never dispatches.
Why it looked like a key problem
SENDGRID_API_KEY was missing, which is true and was the visible symptom. But even with a key set, production would still send nothing, because the sender is absent. The missing key was masking a much larger gap.
What this means for #431
Setting RESEND_API_KEY on the Supabase project is correct and harmless, but it only pre-positions the credential. The thing it actually unblocks today is the marketing contact form, which runs on EAS Hosting and does not touch Supabase at all.
Fix
Decide which of these functions should exist in production, then deploy them (scripts/deploy-functions.sh handles the mechanics). notify-send-worker needs a schedule or a queue trigger to drain deliveries — worth confirming how it is meant to be invoked before deploying it, since a worker nothing calls is no better than a worker that is absent.
Also worth checking whether the same gap exists on the dev and preview Supabase projects (pmtdqrfpumqwkdhpgwcz, uhjkipdwayqfihkanabk) — neither is visible to the Supabase login on this machine, which is its own problem.
Activity
feat(notifications): deploy the pipeline that was never deployed (#436)
thinkclay commentedon Jul 30, 2026
Pipeline deployed and verified working in production —
d9099a80e. One seed command remains before it runs unattended.Deployed (12 functions now, was 6): the seven notify-* functions, send-team-invitation, and webhooks-email (a wrapper slug for the nested webhooks/email handler).
Why it had never worked, beyond just not being deployed:
supabase.external_url,app.service_role_key) that don't exist on hosted projects, so it silently scheduled nothing.notify-publishhad no auth check behindverify_jwt=false— an open endpoint that would email arbitrary content to any user. All seven functions now require the service role key as Bearer (constant-time compare, fail closed). Verified: no-auth, anon-key-as-bearer, and unsigned-webhook probes all 401.Scheduling (migration 337, applied to prod): six pg_cron jobs — send-worker every minute, receipts /15, daily+weekly digests, both expiration scanners. Jobs read the functions URL and service key from Vault at run time, so the job text carries no secret and rotation is a one-row update.
End-to-end proof: inserted a queued email delivery (the first row
core.notification_deliverieshas ever held), invoked the worker →{"processed":1,"results":[{"id":1,"status":"sent"}]}→ row hasprovider_msg_id, message reacheddeliveredin Resend from[email protected].Cron is firing every minute and currently 401s by design — the Vault
service_role_keysecret isn't seeded (the URL half already is). Remaining step:After that, cron-driven runs go 200 and the pipeline is fully autonomous. Optional follow-ups: seed dev/preview the same way, and set
RESEND_WEBHOOK_SECRET(webhook endpoint now live at.../functions/v1/webhooks-email) so delivery statuses flow back.thinkclay commentedon Jul 30, 2026
Fully autonomous and verified. After the Vault seed:
200 {"ok":true,"processed":0}(was 401 by design pre-seed)status=sent,attempts=1, provider id stored, and the message reacheddeliveredin Resend from[email protected]The pipeline runs itself: pg_cron → notify-send-worker → Resend, with receipts, digests and expiration scanners on their own schedules. Closing.
Follow-ups tracked elsewhere / optional:
./scripts/seed-notify-cron-vault.sh dev|preview) once those projects are accessibleRESEND_WEBHOOK_SECRETfor delivery-status callbacks (endpoint live at.../functions/v1/webhooks-email, fails closed until then)