Prerequisites
To get the most out of this guide, you’ll need to:1. Install
Get the Emailr Node.js SDK.2. Create an email template
Start by creating your email template oncomponents/email-template.tsx.
components/email-template.tsx
3. Send email using React
Create a route file underapp/api/send/route.ts (or pages/api/send.ts if you’re using Pages Router).
Import the React email template and send an email using the react parameter.
4. Try it yourself
Next.js Example (App Router)
See the full source code.
Next.js Example (Pages Router)
See the full source code.