wix-incubator / mjml-react

React component library to generate the HTML emails on the fly
MIT License
993 stars 50 forks source link

Export like mjml #43

Closed fmaillet24 closed 2 years ago

fmaillet24 commented 3 years ago

Hello, Nice work !

Is there a way to export mjml-react like mjml command line do ?

Thanks

mastertheblaster commented 3 years ago

Hey @fmaillet24

Could you provide some link to documentation/resource/example, I am not really sure I get the issue/question.

Do You need some API which compiles and returns either MJML or HTML syntax ?

import { render, renderToMjml } from 'mjml-react';

const email = (<Mjml>...</Mjml>);

console.log(render(email)); // will print out the HTML
console.log(renderToMjtml(email)); // will print out the MJML
fmaillet24 commented 3 years ago

Hello,

Sorry if I was not clear, I'm just looking for something like mjml [input] -o path.html. I need to export a lot of template to html. I wrote something custom, but I just wanted to know if I missed something from mjml-react.

Thanks a lot Have a nice day

mastertheblaster commented 3 years ago

Hey,

Are your templates written in react or in mjml ? If it's react, then what bundler or transpiler do you use ? Maybe your project is public and you could share the link ?

Regards

daliusd commented 2 years ago

As there is no activity on this issue I'm closing it.