Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,20 @@ console.log(`Email ${data.id} with a React template has been sent`);
```

> [!NOTE]
> If your endpoint is a JS/TS file, render the template (i.e., pass `EmailTemplate({ firstName: "John", product: "MyApp" })` instead of the component).
> If you're sending emails from a file that doesn't have JSX transpilation set up (e.g., in a `.js`/`.ts` file instead of JSX/TSX), use React's `jsx` runtime function instead of passing the component as JSX:
>
>```js
>import { jsx } from 'react/jsx-runtime'
>import EmailTemplate from '../components/EmailTemplate';
>
>await resend.emails.send({
> from: 'you@example.com',
> to: 'user@gmail.com',
> replyTo: 'you@example.com',
> subject: 'hello world',
> react: jsx(EmailTemplate, { firstName:"John", product:"MyApp" }),
>});
>```

## License

Expand Down