Skip to main content

Resend Integration

Resend is the primary email delivery provider for Kinetic Email.

Setup

  1. Create a Resend account at resend.com
  2. Add and verify your sending domain
  3. Generate an API key
  4. Set RESEND_API_KEY in environment variables

How It's Used

The /api/send-email.ts endpoint sends emails through Resend:

const response = await fetch('https://api.resend.com/emails', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.RESEND_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
from: 'Kinetic Email <noreply@kinetic.email>',
to: recipientEmail,
subject: subject,
html: processedHtml,
}),
});

Email Processing Before Send

Before passing HTML to Resend, the endpoint:

  1. Injects tracking pixels
  2. Resolves relative image URLs to absolute
  3. Adds attribution banner (for non-self sends)
  4. Sanitizes sender email (XSS prevention)

Delivery Status

The /api/resend-status.ts endpoint checks delivery status for sent emails using Resend's API.

Fallback Provider

AWS SES is available as a fallback via /api/send-email-ses.ts. Both endpoints have the same request format and processing pipeline.