Skip to content

Commit

Permalink
fix: React (#98)
Browse files Browse the repository at this point in the history
* fix: React

* chore: Bump to v0.15.1
  • Loading branch information
bukinoshita authored May 25, 2023
1 parent b2df051 commit 97491e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 6 additions & 0 deletions src/emails/emails.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { render } from '@react-email/render';
import { Resend } from '../resend';
import {
CreateEmailOptions,
Expand All @@ -20,6 +21,11 @@ export class Emails {
payload: CreateEmailOptions,
options: CreateEmailRequestOptions = {},
): Promise<CreateEmailResponse> {
if (payload.react) {
payload.html = render(payload.react);
delete payload.react;
}

const data = await this.resend.post<CreateEmailResponse>(
'/emails',
payload,
Expand Down

0 comments on commit 97491e8

Please sign in to comment.