diff --git a/package.json b/package.json index acd4bc16..a6a76c1b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "resend", - "version": "0.15.0", + "version": "0.15.1", "description": "Node.js library for the Resend API", "main": "build/src/index.js", "typings": "build/src/index.d.ts", diff --git a/src/emails/emails.ts b/src/emails/emails.ts index fa75b242..269ef88d 100644 --- a/src/emails/emails.ts +++ b/src/emails/emails.ts @@ -1,3 +1,4 @@ +import { render } from '@react-email/render'; import { Resend } from '../resend'; import { CreateEmailOptions, @@ -20,6 +21,11 @@ export class Emails { payload: CreateEmailOptions, options: CreateEmailRequestOptions = {}, ): Promise { + if (payload.react) { + payload.html = render(payload.react); + delete payload.react; + } + const data = await this.resend.post( '/emails', payload,