How the pieces connect
The data flow has three hops. A row change in Postgres fires a trigger, the trigger calls a Supabase Edge Function over HTTP, and the function hits Resend's REST API to send mail. Each hop runs in a different place: triggers and pg_net (or a webhook via Supabase Database Webhooks) live inside Postgres, the Edge Function runs on Deno at the edge, and Resend handles the actual SMTP delivery and reputation. The cleanest wiring is a Database Webhook on INSERT/UPDATE pointed at the function URL — it passes the changed record and old_record as JSON so you don't query the table again. Inside the function you read Deno.env.get("RESEND_API_KEY") and POST to https://api.resend.com/emails with from, to, subject, and html. Keep the function thin: validate the payload, build the email, send, return 200.