GrapesJS / preset-newsletter

GrapesJS preset configuration for the newsletter editor.
https://grapesjs.com/demo-newsletter-editor.html
BSD 3-Clause "New" or "Revised" License
189 stars 143 forks source link

Add dynamic content using PHP Variable #109

Closed robinvibs10 closed 1 year ago

robinvibs10 commented 2 years ago

Hi,

How can I echo php content to newsletter blocks, PHP code is not working in the import codes...

I want to dynamically populate content to a specific blocks...

ferulisses commented 1 year ago

Use Javascript to populate content.

Using the example: https://github.com/GrapesJS/preset-newsletter#usage

You can populate the content with:

editor.setComponents(inline_html);

If you have separated HTML and CSS, you can use:

editor.setComponents(html);
editor.setStyle(css);