Your software
My Mautic version is: 4.1.0
My PHP version is: 7.4
My Database type and version is:
MariaDB 10.2
Your problem
My problem is: When I open the email builder, nothing works. The code editor is not displayed, the close button does not work, etc.
JAVASCRIPT ERROR
2:4 Uncaught Error: No valid HTML template found
at Function.getOriginalContentHtml (content.service.js:119)
at l.value (builder.service.js:204)
at l.value (builder.service.js:107)
at Object.s [as launchBuilder] (builder.js:33)
at HTMLButtonElement.onclick (2:1601)
at Object.trigger (libraries.js?v35708ed5:683)
at HTMLButtonElement. (libraries.js?v35708ed5:688)
at Function.each (libraries.js?v35708ed5:153)
at jQuery.fn.init.each (libraries.js?v35708ed5:144)
at jQuery.fn.init.trigger (libraries.js?v35708ed5:688)
These errors are showing in the log: none
Steps I have tried to fix the problem: clear:cache
Did u upgrade from 3+? Make sure your templated have the right format in the config files. The editor value must be an array. Check template config file structure in the docs.
With the snippet you suggested, the CODE MODE works properly. I am able to open the editor and make modifications.
I first had to add it manually to the custom_html field in the emails table
Okay, at least we know what the problem is in your install. When you open code mode the html is not properly created… try any other template and overwrite the code.
I had the same problem on a clean Mautic 4.1.1 install ( PHP Version 7.4.27, MariaDB 10.6.5) and tried various solutions, including a fresh reinstall.
What finally solved it, and it is extremely strange, is when I reinstalled it with a prefix in my database tables. I know how it sounds, but would it make any sense at all?
I did another fresh install with same setup (docker, PHP Version 7.4.27, MariaDB 10.6.5) with no table prefix, same theme for GrapesJS, and it worked fine.
So I have no idea what causes the problem, but it does happen intermittently.
This is true for all Mautic.
Usually happens if you run your cronjobs with the wrong user. Make sure it’s the same as the web server user. Most of the time it’s www.
Just a thought, might be another issue. Good luck.