Resend with React Email
Is it possible to send emails with react email components via Resends Convex Componentm?
10 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Update @react-email/render to latest
Still get the same error on v1.3.1
Surprising, maybe node still needs polyfills depending on node version - but you don't actually need node for this, it's fully supported in the Convex runtime.
In the mean time I just fixed it by manually pasting the HTML after "compiling" the JSX email component and passing that directly as a template literal
I'm not able to get react-email to work either
If someone can share a repro I can take a look - it definitely works out of the box at this point.
adding
import React from "react"; in where i have my action that has the render email worked for me. React 19 as wellI'm sending now all my react emails from the client, but this is not ideal. So importing react can make possible rendering and sending emails from the backend?
Confirming here that i renamed my convex file to .tsx (the file which contains all my resend component send email actions) and it works out of the box importing the react components from react-email and the pretty/render functions. Updated @react-email/render to latest and NOT using "use node".
Basically I created an "emails.tsx" file on my convex folder that has all the actions for sendings (sendUserWelcomeEmail, sendUserNotificationEmail) and then I call these actions with the scheduler from my mutations across the app.
Also importing React is not required for me