Imported from MinhDuyDEV/pi-harness (
.pi/skills/resend/SKILL.md). Install upstream withnpx skills add MinhDuyDEV/pi-harness --skill resend. Copyright stays with the author.
Resend (Email)
Iron Laws
When to Use
Transactional sends (magic link, verification, password reset, receipts); newsletters and bulk notifications; inbound email handling; building or previewing email templates.
Setup
npm i resend react-email @react-email/components
export RESEND_API_KEY="re_..."
Method
- Model each email as a React Email component in
emails/; preview locally withemail devbefore sending anything. - Send with the typed SDK, passing the component to the
reactprop. - Use
POST /emails/batch(max 100) for multiple distinct emails; Audiences +contactsAPI for managed lists. - For replies/inbound: configure the receiving domain (MX record or
.resend.app), subscribe a webhook toemail.received, then retrieve content via the API — the webhook payload does not contain the body.
References
- See
references/send-email.mdfor single vs batch endpoints, scheduling, attachments, and idempotency. - See
references/react-email.mdfor template components, client compatibility, and the preview workflow. - See
references/receive-email.mdfor inbound domains, webhook events, and content retrieval.
Red Flags
String-concatenated HTML instead of React Email; API key committed to code; polling or IMAP for inbound; treating the inbound webhook payload as if it contained the full body; test emails sent to real addresses; bulk sends without an unsubscribe link; missing replyTo; no error or rate-limit handling around send calls; "templates later" (templates first).