diff --git a/.env.example b/.env.example index b8ec338..0fd56f3 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1 @@ -RESEND_API_KEY="" -EMAIL_FROM="" -EMAIL_TO="" \ No newline at end of file +RESEND_API_KEY="" \ No newline at end of file diff --git a/app/api/send/route.ts b/app/api/send/route.ts index fd66b62..11060e5 100644 --- a/app/api/send/route.ts +++ b/app/api/send/route.ts @@ -7,9 +7,9 @@ const resend = new Resend(process.env.RESEND_API_KEY); export async function GET() { try { const data = await resend.sendEmail({ - from: process.env.EMAIL_FROM || '', - to: process.env.EMAIL_TO || '', - subject: "hello world", + from: 'onboarding@resend.dev', + to: 'delivered@resend.dev', + subject: "Hello world", react: EmailTemplate({ firstName: "John", product: "Resend" }), }); diff --git a/next.config.js b/next.config.js index dd5cd3f..fef5fff 100644 --- a/next.config.js +++ b/next.config.js @@ -2,6 +2,4 @@ function throwError(envVar) { throw `Abort: You need to define ${envVar} in the .env file.` } -if (!process.env.RESEND_API_KEY) return throwError('RESEND_API_KEY'); -if (!process.env.EMAIL_FROM) return throwError('EMAIL_FROM'); -if (!process.env.EMAIL_TO) return throwError('EMAIL_TO'); \ No newline at end of file +if (!process.env.RESEND_API_KEY) return throwError('RESEND_API_KEY'); \ No newline at end of file