Contact > Send Email > Existing Template - Broken

Your software
My Mautic version is: 4.0.1
My PHP version is: 7.4.23
My Database type and version is: MariaDB v1:10.2.40+maria~bionic

Your problem
My problem is: Campaign emails stopped going out for some reason. I tried sending one of the transaction emails to my contact record. Selecting the existing template sends an email with nothing in it. The UI also prompts an error if the body of the email window is empty.

These errors are shown in the log: Error log is empty. Nothing jumping out in server logs

Steps I have tried to fix the problem: Cleared cache folder

Mautic 4.0.1 comes with a new editor also in this page. I’m talking about the editor by the “Body” section of your screenshot.
However in this screenshot it is still the old one. Could it be, that the old javascript is stuck in your browser?

I just flushed the cache of the browser in DEV mode and it’s still showing the same editor.

FYI, I have removed the GrapesJS editor and am using the original editor. GrapesJS was causing too many issues.

I have seen an error in the Chrome DEV console

closing the send window produces this error in the console

As @joeyk was suggesting, this Javascript error indicates that the new Richt Text Editor cannot the loaded. With Mautic 4 it should always be loaded.

@aglyons Do you have the same error with other textareas? E.g. if you add a note to a contact.

I don’t get an error when opening the note modal
image

but if you cancel the note then I get this error in the console

This shows that your code is trying to load froala. IMO this should not happen. Froala was replaced with CKE in this PR TPROD-143 Replaces Froala with CKEditor 4 as the default WYSIWYG by alanhartless · Pull Request #9843 · mautic/mautic · GitHub

My first step would be: clear all caches
Can you reproduce the same issue with a clean install of Mautic?

I just checked on another install of Mautic I have, currently running v3.3.3. The ‘select existing template’ drop-down populates the editor as expected and emails send.

I then updated that install to v4.0.1 and cleared the cache manually leaving only IP data. Now it does the same as it does on my first Mautic install. It just spins the icon trying to load the template but never loads.

image

The CKEditor error only pops up in the console when selecting an existing template.

Also, clicking ‘Cancel’ on the modal window produces the Froala error.

I suspect that this editor window was missed in the editor overhaul that was done and it’s still calling retired code.

I just tested enabling GrapesJS editor. I cleared the cache and now that editor is working as expected. This specific editor REQUIRES GrapesJS in order for it to work at all. It will not function using the original editor when GrapesJS is not enabled.

The problem is I have disabled GrapesJS as I was having more issues trying to get emails to work period. While not having this specific function is not the end of the world, it would be prudent to check what is different about this editor compared to the others in the system.