[Node.js SDK]
Next.js
Send transactional email from Next.js App Router and Server Actions with the official Node.js SDK.
1
Install the Node.js package
npm install reloop-email2
Send email from Next.js
send_email.ts
1import Reloop from 'reloop-email';2
3const reloop = new Reloop(process.env.RELOOP_API_KEY);4
5export async function POST() {6 const { data, error } = await reloop.emails.send({7 from: 'Acme <onboarding@yourdomain.com>',8 to: ['delivered@yourdomain.com'],9 subject: 'Hello from Next.js',10 html: '<strong>It works!</strong>',11 });12
13 if (error) {14 return Response.json({ error }, { status: 500 });15 }16
17 return Response.json({ id: data.id });18}3
GitHub, examples, and API reference
4
Need more help?
- Need help? Contact Support.
- Chat with Reloop developers on Discord.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.
Send with Next.js.
Get an API key and ship transactional email from Next.js using the official Node.js SDK.