Replies: 3 comments 1 reply
-
Why exactly would it be a time saver? Is it because you are doing |
Beta Was this translation helpful? Give feedback.
-
+1 I'd also be interested in this feature. My company has built this functionality on top of react-email, and exporting by a file path is something we wanted but had to hand-roll. We would love to be able to just run Exporting by file path is useful because it is a more targeted rendering process. If email "A" has a syntax error or something, that shouldn't stop me from exporting email "B" |
Beta Was this translation helpful? Give feedback.
-
Docs say to use function export(){
fs.readdirSync("./emails").filter((folderName) => {
const thereisFilter = getFilteredFromProcessArgv()
return isEmailFolder(folderName) && folderName.startsWith(thereisFilter)
}).forEach(folderName => {
const module = await import(`./emails/mail.tsx`);
const html = await render(
<module.default {...module.default.PreviewProps} />,
{
...options,
plainText: false,
}
);
fs.writeFileSync("output.html",{ encoding: "utf-8"})
})
} This is a simplified version of my code. But the idea is the same. You can pass some |
Beta Was this translation helpful? Give feedback.
-
Goals
export
commandBackground
Our system has hundreds of emails, and exporting them takes some time to complete. It would be great if additional flags can be passed to the
export
command to export only the given email instead of all of them. It would be a huge time saver.Proposal
something like this should work:
export --email my-cool-email.tsx
export --email my-cool-email.tsx --email my-other-cool-email.tsx
Beta Was this translation helpful? Give feedback.
All reactions