All operator docs
Help · Operator

How to wire Resend

Get the credentials, plug them in, verify the wiring.

Why Resend?

Resend is the recommended ESP for PubOps. It has a clean API, good deliverability, and the webhook model fits our audience metrics collection.

Get the credentials

  1. Sign up at resend.com.
  2. Go to API KeysCreate API Key. Copy the key (starts with re_). It only shows once.
  3. Optionally go to ContactsSegments and copy a Segment ID if contact synchronization should be limited to one segment. PubOps sends to its exact eligible-recipient set rather than a provider-wide broadcast.
  4. Go to Domains → add and verify your sending domain (e.g. newsletter.yourdomain.com). You'll need to add the DNS records Resend shows you.
  5. Go to Webhooks → add a webhook endpoint. The URL is https://yourdomain.com/api/webhooks/resend. Subscribe to: email.opened, email.clicked, email.bounced, email.complained. Copy the signing secret (Svix format).

Configure the env vars

In your .env.local (dev) or hosting platform's secrets (prod):

RESEND_API_KEY=re_xxxxxxxxxxxx
# Optional: limit contact sync to one Resend segment
RESEND_SEGMENT_ID=xxxxxxxx-xxxx-xxxx
EMAIL_FROM="PubOps <hello@yourdomain.com>"
RESEND_WEBHOOK_SECRET=whsec_xxxxxxxx

Verify

Re-run the setup wizard's connection test, then preview contact synchronization. A live publish should record Resend message IDs for the exact PubOps recipients. A 401 means the key was revoked; a 403 means it lacks access; a 404 on sync usually means the optional segment was deleted.

Webhook troubleshooting

If the audience chart in the post-mortem never updates: check that your webhook endpoint is reachable. From a terminal:

curl -X POST https://yourdomain.com/api/webhooks/resend \
  -H "svix-signature: ..." \
  -d '{"type":"email.opened","data":{"email_id":"..."}}'

You should get { ok: true } back.

How to wire Resend — PubOps