How to build templates server side #570
Replies: 6 comments 7 replies
-
nvm I think I found out what needs to be done. The steps would be:
|
Beta Was this translation helpful? Give feedback.
-
Here's an example of what @rahulravindran0108 listed out above in case anyone is struggling with this: import EmailComponent from "path/to/component";
import { render } from "@react-email/render";
const html = render(EmailComponent({prop1: 'value'})) |
Beta Was this translation helpful? Give feedback.
-
hey @zachgoll Any help:) |
Beta Was this translation helpful? Give feedback.
-
Hey folks! |
Beta Was this translation helpful? Give feedback.
-
@anfragment thanks a lot for releasing your package. I'm trying to render react-emails during runtime as I need to send them out triggered by a node-cron job. I'm using next.js but I can't seem to be able to transform the JSX into a string to pass it to your react-email-dynamic. I tried using ReactDomServer but I get an error saying |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to do this functionality server side completely. I'm actually trying to run a cron job to generate emails to be sent to my users. This package is amazing to iterate on email templates but I'm having a hard time figuring out how to install all of this functionality in something like firebase functions.
What's the best workflow for this ?
Beta Was this translation helpful? Give feedback.
All reactions