## Email (Hatched Send)

This project sends email through Hatched Send. Docs for agents: https://send.hatched.digital/llms.txt

- Send: POST https://send.hatched.digital/api/v1/email with `Authorization: Bearer $HATCHED_SEND_API_KEY`.
  Body: { from, to, subject, html | text | template_id, variables?, reply_to?, tags? }.
- Always send an `Idempotency-Key` header (e.g. `welcome-<userId>`) so retries never send twice.
- Keys starting `sk_test_` log the email but never deliver it. Use them in dev and CI.
  Never commit keys; they live in .env.local / the host's env settings.
- `from` must be on a verified sending domain (GET https://send.hatched.digital/api/v1/domains).
- Delivery events arrive by webhook, signed with `X-HatchedSend-Signature-V1: t=<unix>,v1=<hex>`
  (HMAC-SHA256 of `t + "." + rawBody` with HATCHED_SEND_WEBHOOK_SECRET). Verify before trusting.
- Error type `suppressed` (400) means the address bounced, complained or unsubscribed. Don't retry it.
- MCP server for setup tasks (keys, domains, webhooks, templates): https://send.hatched.digital/mcp
