Integrations / Next.js
Sendersy + Next.js
Send transactional email from Next.js App Router via Sendersy — Resend-compatible API, no client rewrite required.
1. Install
bash
npm install resend
2. Environment variables
bash
SENDERSY_API_KEY=sk_live_... SENDERSY_BASE_URL=https://app.sendersy.com
3. Send an email
ts
// app/api/welcome/route.ts
import { Resend } from 'resend'
const resend = new Resend(process.env.SENDERSY_API_KEY, {
baseUrl: process.env.SENDERSY_BASE_URL + '/v1',
})
export async function POST(req: Request) {
const { email, name } = await req.json()
const result = await resend.emails.send({
from: 'Sendersy <noreply@yourcompany.com>',
to: email,
subject: `Welcome, ${name}!`,
html: `<p>Thanks for signing up, <strong>${name}</strong>!</p>`,
tags: [{ name: 'category', value: 'welcome' }],
})
return Response.json(result)
}4. Using a stored template
ts
// Using a server-side template
import { sendersy } from '@/lib/sendersy'
await sendersy.emails.send({
from: 'noreply@yourcompany.com',
to: user.email,
template_id: 'welcome-template',
variables: { name: user.name, token: signupToken },
})