Deprecation notice: NxVET is deprecating consultation record support in the near future. New integrations should use transcripts, conversations, webhooks, and other NxVET ecosystem data.

Send Email with Resend

Give your NxVET integration the ability to send email — "a recording just finished", "here's today's summary" — using Resend's free plan. No mail server, no code to write yourself; this guide gives you the prompts to paste into Claude Code or Codex.

Last updated: July 31, 2026

Overview

Once you're receiving NxVET events — for example with the Cloudflare Worker from our webhook guide — the most useful next step is usually an email: a note to the front desk when a recording finishes, a daily digest, an alert when something needs attention. Sending email reliably from your own program is surprisingly hard (spam filters distrust unknown senders), so services exist that do exactly this one job. Resend is one of the simplest: your program makes one small web request, and Resend delivers the email properly.

Something happens in NxVET (recording finished, label created, ...)
        ↓
NxVET webhook  →  your Cloudflare Worker
        ↓
The Worker asks Resend to send an email  (one HTTPS request)
        ↓
Resend delivers it  →  your inbox / your team's inboxes

Like the webhook guide, this page is written for people who don't code. Each step is either something only you can do (creating the account, guarding the key) or a ready-made prompt you paste into an AI coding assistant — Claude Code, Codex, or similar — which runs the technical commands for you.

Total time: about 10 minutes for Steps 1–5. Resend's free plan (currently 3,000 emails per month — see resend.com/pricing) is far more than a clinic's notifications will ever use.

Prerequisites

  • An email address for the free Resend account
  • A computer with an AI coding assistant installed — Claude Code, Codex, Cursor, or similar
  • Optional but recommended: the webhook Worker from the Cloudflare guide, so events can trigger emails automatically. (Steps 1–3 work fine without it.)

You do not need: a mail server, a credit card, or programming knowledge. You don't even need your own domain to start — Resend lets you send test emails to your own address right away; a domain only becomes necessary in Step 6, when you want to email other people.

Step 1: Create a Free Resend Account

Accounts and passwords stay in your hands — this part is yours, not the assistant's.

  1. Go to resend.com/signup.
  2. Sign up with your email and a strong password (a password manager is ideal). No credit card is needed.
  3. Verify your email address when the confirmation message arrives.
Good practice: Turn on two-factor authentication (2FA) in the Resend dashboard settings. This account can send email that looks like it comes from your clinic — protect it like any other work account.

Step 2: Create an API Key

An API key is the password your program uses to ask Resend to send email. Create it yourself in the dashboard:

  1. In the Resend dashboard, open API Keys and click Create API Key.
  2. Name it something recognizable, e.g. nxvet-worker.
  3. For permission, choose Sending access — the key can send email but can't change anything else in your account. (Full access is only needed if your assistant will also manage domains for you in Step 6.)
  4. Click create, and copy the key immediately into a password manager. It starts with re_ and — like your NxVET secrets — is shown only once.
Treat re_ keys like whsec_ and nxvet_sk_ secrets: never paste them into chat with your assistant, never put them in code. If a key ever leaks, delete it in the Resend dashboard and create a new one — takes a minute.

Step 3: Send a Test Email — to Yourself

Before wiring anything together, prove the key works. Until you verify a domain (Step 6), Resend runs in a safe testing mode: you send from its built-in address onboarding@resend.dev, and only to the email address you signed up with. That limitation is a feature — nothing can go to a client or colleague by accident while you experiment.

Paste this prompt into your AI assistant:

I want to send a test email through Resend (https://resend.com). I have an
API key. Do NOT ask me to paste the key into this chat — instead, have me
put it in an environment variable or type it into a terminal prompt myself.

Then send one email using the Resend API (POST https://api.resend.com/emails
with the key as a Bearer token):
- from: "NxVET Test "
- to: MY OWN email address (ask me what it is — it must be the address I
  signed up to Resend with, since my domain isn't verified yet)
- subject: "Hello from Resend"
- text: "If you can read this, the API key works."
Show me the response, and explain whether it succeeded in plain language.

Within a few seconds the email should land in your inbox (check spam the first time). The API response contains an id like "id": "49a3999c-..." — that's Resend confirming it accepted the email.

Shortcut for Claude users: Resend also has an official connector for Claude and a hosted MCP server, which let an assistant send email through your account after you approve a browser login — no key handling at all. The manual key from Step 2 is still what your Worker will use, though.

Step 4: Store the Key in Your Worker

If you built the Cloudflare webhook Worker, it can now get its own copy of the key — stored encrypted, exactly like your whsec_ secret was in that guide's Step 6. Paste this prompt:

Run "wrangler secret put RESEND_API_KEY" for the nxvet-webhook-receiver
Worker. It will prompt for the value — let me type or paste the key into
the terminal prompt MYSELF. Do not ask me for the key, and do not echo or
store it anywhere.

When the terminal asks for the value, paste your re_... key and press Enter. From now on the Worker can send email, and nobody — including you — can read the key back out.

Step 5: Email Yourself When Something Happens in NxVET

Now connect the two ends: NxVET events in, email out. Paste this prompt:

Update my nxvet-webhook-receiver Cloudflare Worker: when a
"conversation_completed" event arrives (after signature verification, in the
background handler), send me a notification email through Resend.

Use the exact sendEmail helper from the "Worker code" section of
https://api.nx.vet/resend-email.html . Requirements, in case you cannot
fetch the page:
- POST https://api.resend.com/emails with Authorization: Bearer
  env.RESEND_API_KEY (it is already stored as a Worker secret).
- from: "NxVET Alerts "  (until my domain is
  verified), to: my own email address — ask me for it.
- Subject like "NxVET: recording finished on device ". Include
  the conversationId and deviceId in the body. Do NOT include transcripts
  or any patient/client details in the email.
- Set an Idempotency-Key header of "nxvet-event/" + event.id so NxVET's
  retries can never cause duplicate emails.
- If Resend returns an error, log the status code only.
Then deploy with "wrangler deploy".

Worker code

This is the helper your assistant should add (it can copy it from here verbatim). Included so the page is self-contained — you don't need to read it:

// Add to src/worker.js — sends one email via Resend
async function sendEmail(env, subject, text, eventId) {
    const resp = await fetch('https://api.resend.com/emails', {
        method: 'POST',
        headers: {
            'Authorization': `Bearer ${env.RESEND_API_KEY}`,
            'Content-Type': 'application/json',
            // NxVET may deliver an event more than once; this makes
            // Resend ignore the duplicate instead of emailing twice.
            'Idempotency-Key': `nxvet-event/${eventId}`,
        },
        body: JSON.stringify({
            from: 'NxVET Alerts ',
            to: ['YOUR-EMAIL@example.com'],
            subject,
            text,
        }),
    });
    if (!resp.ok) {
        console.log(`Resend error: HTTP ${resp.status}`);
    }
}

// ...and inside handleEvent's switch, for example:
case 'conversation_completed':
    await sendEmail(
        env,
        `NxVET: recording finished on device ${event.data.deviceId}`,
        `Conversation ${event.data.conversationId} completed on device ` +
        `${event.data.deviceId}. Open app.nx.vet to review it.`,
        event.id
    );
    break;

Deploy, then click Test on your webhook in the NxVET Integrations page — or just finish a real recording — and watch your inbox.

Make it yours. Once this works, the pattern extends to anything: "Also email me when a new_label event arrives", "Send a daily 6pm digest instead of one email per event", "Fetch the conversation from the NxVET API and include its duration." Describe what you want to your assistant; the Examples page and AI agent reference give it everything it needs on the NxVET side, and Resend's own agent reference covers the email side.

Step 6 (Optional): Verify a Domain to Email Your Whole Team

Testing mode only delivers to your own address, and the sender shows as onboarding@resend.dev. To email colleagues — and to send as alerts@yourclinic.com — you verify with Resend that you own your clinic's domain. This is the only step that takes patience, because it involves DNS (the internet's address book for your domain).

  1. In the Resend dashboard, open Domains and click Add Domain.
  2. Enter a subdomain of your clinic's domain, e.g. send.yourclinic.com — Resend recommends this over the bare domain; it keeps your normal email reputation separate.
  3. Resend shows a short list of DNS records to add. These get entered wherever your domain is managed (Cloudflare, GoDaddy, Namecheap, your IT provider...). If that's not you, this prompt hands the job to your assistant:
I'm verifying a domain with Resend. I have a list of DNS records from the
Resend dashboard (TXT and MX records for DKIM and SPF). Help me add them:
first help me figure out where my domain's DNS is managed, then walk me
through adding each record exactly as Resend shows it — or, if my DNS is
on Cloudflare and I'm logged in with Wrangler, add them for me via the
Cloudflare API and show me what you added.
  1. Back in Resend, wait for the domain to show Verified — often within 15 minutes, occasionally up to 72 hours for DNS to spread.
  2. Update the from address in your Worker (ask your assistant: "change the from address to NxVET Alerts <alerts@send.yourclinic.com> and redeploy"), and change to to whoever should get the emails.
No domain? If the clinic doesn't own one, registrars like Cloudflare or Namecheap sell them for roughly $10/year — and if you only ever need emails sent to yourself, testing mode is fine indefinitely.

Good Practices

  • Never put the key in code or chat. The re_ key lives in a password manager and in wrangler secret put — nowhere else. Same rule as every other secret in these guides.
  • Use least-privilege keys. A Sending access key is all the Worker needs. If it ever leaks, the damage is limited to sending email — and you can revoke it in the dashboard in seconds.
  • No patient data in emails. Notification emails should say that something happened and where to look (app.nx.vet), not contain transcripts, SOAP notes, or client names. Email is convenient, not a medical record system.
  • Idempotency keys prevent double emails. NxVET delivers webhooks at least once. The Idempotency-Key header in the Worker code means a redelivered event won't email you twice — keep it when you add features.
  • Prefer digests over floods. One email per event is great for rare events; for busy clinics, ask your assistant for a daily summary instead. Your team will thank you, and spam filters will too.
  • Free tier is plenty, and rate limits are generous. The API allows around 10 requests per second by default — thousands of times more than clinic notifications need. If Resend ever returns HTTP 429, your assistant should add a small retry delay, not a bigger plan.
  • After verifying a domain, add DMARC. One more DNS record (Resend's dashboard explains it) that tells the world's inboxes your domain can't be impersonated — good for deliverability and for security.

Troubleshooting

Symptom Likely cause & fix
HTTP 403: "You can only send testing emails to your own email address" You're in testing mode and the to address isn't the one you signed up with. Either send to your own address, or verify a domain (Step 6) and switch the from address to it.
HTTP 401 from the Resend API The key is wrong or was deleted. Re-run Step 4 with a fresh key from the dashboard (and check the Worker reads env.RESEND_API_KEY, spelled exactly like that).
HTTP 403: "domain is not verified" You changed the from address before the domain showed Verified in the dashboard. Check the Domains page — if it's stuck past 72 hours, use its "Restart verification" button and re-check the DNS records were copied exactly.
API says sent, but no email arrives Check spam first. Then open Emails in the Resend dashboard — every send is listed with its delivery status, which tells you whether the problem is on the sending or receiving side.
Two identical emails for one event The Idempotency-Key header is missing or differs between retries. Make sure it's built from the NxVET event id, as in the Worker code above.
Webhook test works but no email is triggered The NxVET Test button sends a ping event, and the email is wired to conversation_completed. That's expected — trigger a real event, or ask your assistant to temporarily email on ping too while testing.

Stuck? Ask your assistant to compare three views side by side: NxVET's delivery history, wrangler tail, and the Resend dashboard's Emails page — the failure point will be in exactly one of them. And support@nx.vet is happy to help.

Checklist