winsoroaks
winsoroaks12mo ago

resend lib started to fail

when i configured my resend clients on 11/27, it was working perfectly. i havent touched the email components until the past weekend and the same code has been failing. i upgraded my convex to 1.7 on 12/30. it's unlikely that this is breaking my resend code. im quite baffled and started reaching out to resend support today. i wonder if others around still have their resend clients working with convex 1.7. after some trial and error, the resend.emails.send func that hits the POST /emails endpoint only fails when im using a template.
// fails
await resend.emails.send({
from: "onboarding@resend.dev",
to: process.env.MY_TEST_EMAIL!,
subject: "Hello World",
react: TestResendEmail({ url: "John" }) as React.ReactElement,
})

// success
await resend.emails.send({
from: "onboarding@resend.dev",
to: process.env.MY_TEST_EMAIL!,
subject: "Hello World",
html: "<strong>It works!</strong>",
})
// fails
await resend.emails.send({
from: "onboarding@resend.dev",
to: process.env.MY_TEST_EMAIL!,
subject: "Hello World",
react: TestResendEmail({ url: "John" }) as React.ReactElement,
})

// success
await resend.emails.send({
from: "onboarding@resend.dev",
to: process.env.MY_TEST_EMAIL!,
subject: "Hello World",
html: "<strong>It works!</strong>",
})
fwiw, here's the error i see in the logs from resend
{
"name": "application_error",
"message": "Something went wrong while saving email",
"statusCode": 500
}
{
"name": "application_error",
"message": "Something went wrong while saving email",
"statusCode": 500
}
would appreciate any insights. thanks!
2 Replies
erquhart
erquhart12mo ago
Is this action using the convex runtime or node?
winsoroaks
winsoroaksOP12mo ago
ooof looks like i accidentally removed it... 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ 🤦‍♂️ thank u sir. omg i hate myself

Did you find this page helpful?