GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
648 stars 229 forks source link

Convert MJML to Grapesjs JSON data on server side #313

Closed jay-softsages closed 1 year ago

jay-softsages commented 1 year ago

Hi, I love the editor!

I have MJML markup and I need to convert them to GrapesJs JSON { styles : [], assets : [], pages : []} I was using the Unlayer Editor before but now I need to change all the email templates to be supported by GrapesJs. So I manually converted the Unlayer Json to MJML and now as GrapesJs is a client-side module I need help so that I can run a JS script in the server to change all the Unlayer stored templates to GrapesJs JSON.

My plan - Unlayer JSON -> MJML -> GrapesJs JSON

If I copy the MJML and paste it into the Import MJML popup of the editor then I get the output and can also get the JSON but I wonder if this is possible in the backend so that I don't have to manually copy and paste the MJML and save hundreds of templates.

I also saw this https://github.com/artf/grapesjs/discussions/3672 which is kind of similar to running GrapesJs on the server side. I am stuck at the last step to convert MJML to GrapesJs JSON so please help if anybody has already worked with a similar task.

jay-softsages commented 1 year ago

Thanks @artf for solving my issue - https://github.com/artf/grapesjs/discussions/4840