Resend Integration
Resend is the primary email delivery provider for Kinetic Email.
Setup
- Create a Resend account at resend.com
- Add and verify your sending domain
- Generate an API key
- Set
RESEND_API_KEYin 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:
- Injects tracking pixels
- Resolves relative image URLs to absolute
- Adds attribution banner (for non-self sends)
- 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.