Skip to content

Commit

Permalink
chore: Upgrade to Next 14 (#22)
Browse files Browse the repository at this point in the history
Co-authored-by: Bu Kinoshita <[email protected]>
  • Loading branch information
zenorocha and bukinoshita authored Nov 2, 2023
1 parent 3d6dfc0 commit 74fc6a4
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 203 deletions.
10 changes: 7 additions & 3 deletions app/api/send/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ const resend = new Resend(process.env.RESEND_API_KEY);

export async function POST() {
try {
const data = await resend.emails.send({
from: 'Acme <onboarding@resend.dev>',
const { data, error } = await resend.emails.send({
from: 'Acme <onboarding@resends.dev>',
to: ['[email protected]'],
subject: "Hello world",
react: EmailTemplate({ firstName: "John" }) as React.ReactElement,
});

return NextResponse.json(data);
if (error) {
return NextResponse.json({ error });
}

return NextResponse.json({ data });
} catch (error) {
return NextResponse.json({ error });
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"dev": "next dev"
},
"dependencies": {
"next": "13.4.16",
"react": "18.2.0",
"react-dom": "18.2.0",
"next": "latest",
"react": "latest",
"react-dom": "latest",
"resend": "latest"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 74fc6a4

Please sign in to comment.