Get the rendered html from the editor?
casesolved-co-uk opened this issue · comments
Hi,
I've not used typescript before so struggling to understand how I get the rendered HTML from an MJML template. getHTML()
returns the MJML.
I can see I need to call the command cmdGetMjmlToHtml
or mjml-code-to-html
, how do I do that?
Thanks
Hi,
To run any command you call for `editor.runCommand("command-name").
I sugest you take a look at the tutorials in the grapesjs docs. Here you can see how to add custom commands and how to run them. https://grapesjs.com/docs/modules/Commands.html#basic-configuration
You can experiment more using the demo version of grapejs standard or with mjml online through the console in the devtools.
Thanks @gustavohleal
I just figured out this.editor.Command.run
, but runCommand is even better!
Yes it was in the documentation 😊