Integrations
Send email using Resend
Learn how to send an email using React Email and the Resend Node.js SDK.
Resend was built by the same team that created React Email, which makes this our recommendation to send emails.
1. Install dependencies
Get the Resend Node.js SDK.
npm install resend
2. Create an email using React
Start by building your email template in a .jsx
or .tsx
file.
email.jsx
import * as React from 'react';
import { Html } from '@react-email/html';
import { Button } from '@react-email/button';
export function Email(props) {
const { url } = props;
return (
<Html lang="en">
<Button href={url}>Click me</Button>
</Html>
);
}
export default Email;
3. Send email
When integrating with other services, you need to convert your React template into HTML before sending. Resend takes care of that for you.
Import the email template you just built and use the Resend SDK to send it.
index.jsx
import { Resend } from 'resend';
import { Email } from './email';
const resend = new Resend('re_123456789');
resend.sendEmail({
from: 'you@example.com',
to: 'user@gmail.com',
subject: 'hello world',
react: <Email firstName="John" product="MyApp" />,
});
Try it yourself
Resend example
See the full source code.