# Email builder not working on v4.1

**URL:** <https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [December 5, 2021, 12:14am UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903 "2021-12-05T00:14:06Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![cleyverson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cleyverson/32/3304_2.png) [@cleyverson](https://forum.mautic.org/u/cleyverson)\
**Post date:** [December 5, 2021, 12:14am UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/1 "2021-12-05T00:14:06Z")

</div>

**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

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [December 5, 2021, 7:23am UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/2 "2021-12-05T07:23:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [December 5, 2021, 7:27am UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/3 "2021-12-05T07:27:16Z")

</div>

The config.json should look like this:

```auto

{
  "name": "Great Theme",
  "author": "Mr. Robot",
  "authorUrl": "https://mautic.org",
  "builder": "[grapesjsbuilder]",
  "features": [
    "email"
  ]
}

```

Mind the line with the editor. It has to be an array using [.]

---

<div class="post-metadata">

**Author:** ![cleyverson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cleyverson/32/3304_2.png) [@cleyverson](https://forum.mautic.org/u/cleyverson)\
**Post date:** [December 5, 2021, 11:07am UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/4 "2021-12-05T11:07:21Z")

</div>

It is a fresh installation.

Have a look to the loom video. [Loom | Free Screen & Video Recording Software](https://www.loom.com/share/c3b560fc1a3046aab7bbfce81efde8ea)

I am actually trying to create an email “template” and paste an html.

Any suggestion?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [December 5, 2021, 6:46pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/5 "2021-12-05T18:46:11Z")

</div>

Hi,  
Can you plz check if by plugins grapesjs is enbled?

---

<div class="post-metadata">

**Author:** ![cleyverson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cleyverson/32/3304_2.png) [@cleyverson](https://forum.mautic.org/u/cleyverson)\
**Post date:** [December 5, 2021, 7:06pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/6 "2021-12-05T19:06:34Z")

</div>

Hi,

How to check if it is enabled?

And if it is not, how to enable it?

Thanks

---

<div class="post-metadata">

**Author:** ![cleyverson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cleyverson/32/3304_2.png) [@cleyverson](https://forum.mautic.org/u/cleyverson)\
**Post date:** [December 5, 2021, 7:32pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/7 "2021-12-05T19:32:52Z")

</div>

My issue is when I try to open a CODE MODE but code editor isn’t loaded properly

 ![Untitled](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9385f2d2e6bd509b2c8d3cebdb73eb063082ed1a.png)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [December 5, 2021, 7:50pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/8 "2021-12-05T19:50:05Z")

</div>

Go to plugins and check if the grapesjs is enabled. Click the gear icon \> plugins

---

<div class="post-metadata">

**Author:** ![cleyverson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cleyverson/32/3304_2.png) [@cleyverson](https://forum.mautic.org/u/cleyverson)\
**Post date:** [December 5, 2021, 8:23pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/9 "2021-12-05T20:23:54Z")

</div>

Yes, it is enabled.  
What else I can check to start being able to use the CODE MODE?

I also did

```auto
php bin/console mautic:plugins:update
php bin/console cache:clear
php bin/console mautic:assets:generate

```

Still not working

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [December 5, 2021, 10:03pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/10 "2021-12-05T22:03:56Z")

</div>

Is this an email you already saved? If so…  
Can you check what the first line of the code is in this email’s custom\_html column in the email table?

---

<div class="post-metadata">

**Author:** ![cleyverson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cleyverson/32/3304_2.png) [@cleyverson](https://forum.mautic.org/u/cleyverson)\
**Post date:** [December 5, 2021, 10:29pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/11 "2021-12-05T22:29:31Z")

</div>

Yeap! I have just created the email and saved it.  
The custom\_html field in the emails table is empty (not null)

I am not being able to edit it since the editor does not open properly (javascript message I’ve sent in the previous email)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [December 6, 2021, 4:17pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/12 "2021-12-06T16:17:55Z")

</div>

Weird.

Add this and plz check if it opens afterwards:

```auto
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>

<body>
The content of the document......
</body>

</html>

```

---

<div class="post-metadata">

**Author:** ![cleyverson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cleyverson/32/3304_2.png) [@cleyverson](https://forum.mautic.org/u/cleyverson)\
**Post date:** [December 6, 2021, 4:42pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/13 "2021-12-06T16:42:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [December 7, 2021, 5:49am UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/14 "2021-12-07T05:49:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cleyverson](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cleyverson/32/3304_2.png) [@cleyverson](https://forum.mautic.org/u/cleyverson)\
**Post date:** [December 10, 2021, 1:16pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/15 "2021-12-10T13:16:44Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![stephlegrand](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stephlegrand/32/1049_2.png) [@stephlegrand](https://forum.mautic.org/u/stephlegrand)\
**Post date:** [January 16, 2022, 2:12pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/16 "2022-01-16T14:12:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![stephlegrand](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/stephlegrand/32/1049_2.png) [@stephlegrand](https://forum.mautic.org/u/stephlegrand)\
**Post date:** [January 16, 2022, 4:43pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/17 "2022-01-16T16:43:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ckieg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ckieg/32/7115_2.png) [@ckieg](https://forum.mautic.org/u/ckieg)\
**Post date:** [March 22, 2022, 3:21pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/18 "2022-03-22T15:21:10Z")

</div>

What worked for me was to set file/directory permissions again (as suggested in the install instructions). Seems it has to be done frequently…

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 22, 2022, 3:34pm UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/19 "2022-03-22T15:34:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kivelov](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/kivelov/32/6942_2.png) [@kivelov](https://forum.mautic.org/u/kivelov)\
**Post date:** [December 24, 2022, 10:39am UTC](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903/20 "2022-12-24T10:39:31Z")

</div>

email template save and apply button not show : solve the problem:

 ![sdgfdgfsdfsdfsdf](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/5dbe8d1ba7ade17c4663f57d7258ea68e6a53a29.png)

[Next page](https://forum.mautic.org/t/email-builder-not-working-on-v4-1/21903.md?page=2)
