Node.js library for the Resend API. Use when: <a href="https://resend.com/docs/send-with-nextjs">Next.js</a>; <a href="https://resend.com/docs/send-with-remix">Remix</a>; <a href="https://resend.com/docs/send-with-nuxt">Nuxt</a>. NOT for: SMS or push notifications; real-time chat messaging.
Node.js library for the Resend API. ```jsx import React from 'react'; export default function EmailTemplate({ firstName, product }) { return ( <div> <h1>Welcome, {firstName}!</h1> <p>Thanks for trying {product}.
npm install resend
npm install resend
# or
yarn add resend
import { Resend } from 'resend';
const resend = new Resend('re_xxxx...xxxxxx');
const { data } = await resend.emails.send({
from: '[email protected]',
to: '[email protected]',
replyTo: '[email protected]',
subject: 'hello world',
text: 'it works!',
});
console.log(`Email ${data.id} has been sent`);
const { data } = await resend.emails.send({
from: '[email protected]',
to: '[email protected]',
replyTo: '[email protected]',
subject: 'hello world',
html: '<strong>it works!</strong>',
});
console.log(`Emaill ${data.id} with customer HTML content has been sent.`);
import React from 'react';
export default function EmailTemplate({ firstName, product }) {
return (
<div>
<h1>Welcome, {firstName}!</h1>
<p>Thanks for trying {product}. We’re thrilled to have you on board.</p>
</div>
);
}
import { Resend } from 'resend';
const resend = new Resend('re_xxxx...xxxxxx');