diff --git a/app/api/send/route.ts b/app/api/send/route.ts index 2a2cb48..16952de 100644 --- a/app/api/send/route.ts +++ b/app/api/send/route.ts @@ -1,5 +1,4 @@ import { EmailTemplate } from '../../../components/email-template'; -import { NextResponse } from 'next/server'; import { Resend } from 'resend'; import * as React from 'react'; @@ -8,18 +7,18 @@ const resend = new Resend(process.env.RESEND_API_KEY); export async function POST() { try { const { data, error } = await resend.emails.send({ - from: 'Acme ', + from: 'Acme ', to: ['delivered@resend.dev'], subject: "Hello world", react: EmailTemplate({ firstName: "John" }) as React.ReactElement, }); if (error) { - return NextResponse.json({ error }); + return Response.json({ error }); } - return NextResponse.json({ data }); + return Response.json({ data }); } catch (error) { - return NextResponse.json({ error }); + return Response.json({ error }); } }