You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm encountering a persistent 500 Internal Server Error when attempting to send emails using the Resend API with a React email template in my Next.js project. I have tried various debugging methods but haven't been able to resolve the issue.
Here are some relevant code snippets below, and the GitHub repo is down below.
app/api/send/route.ts
import{Resend}from"resend";import{MeetingRequest}from"@/api/email-templates/MeetingRequest";constresend=newResend(process.env.NEXT_PUBLIC_RESEND_KEY);exportasyncfunctionPOST(request: Request){const{
to_email,
receiver_name,
scheduler_id,
scheduler_name,
scheduled_time,
scheduler_tz,
question_title,
question_id,
sender_note,}=awaitrequest.json();try{const{ data, error }=awaitresend.emails.send({from: "Codey from CodingOH <[email protected]>",to: [to_email],subject: `You received a meeting request from ${scheduler_name}!`,react: MeetingRequest({
receiver_name,
scheduler_id,
scheduler_name,
scheduled_time,
scheduler_tz,
question_title,
question_id,
sender_note,}),});if(error){console.error("[UP] Error sending email:",error);returnResponse.json({ error },{status: 500});}returnResponse.json({ data });}catch(error){console.error("[DOWN] Error sending email:",error);returnResponse.json({ error },{status: 500});}}
I'm encountering a persistent
500 Internal Server Error
when attempting to send emails using the Resend API with a React email template in my Next.js project. I have tried various debugging methods but haven't been able to resolve the issue.Here are some relevant code snippets below, and the GitHub repo is down below.
app/api/send/route.ts
app/questions/[id]/route.tsx
api/email-templates/MeetingRequest.tsx
GitHub Repo: https://github.com/jesuschrist-immanuel/stack-overflow-clone/
The last time I tried to make it work, I got this error:
Error sending meeting request email: {"error":{}}
Any guidance or assistance in resolving this issue would be greatly appreciated!
The text was updated successfully, but these errors were encountered: