Mautic Community Forums

Theme missing email.html.twig

Your software
My Mautic version is: 4.0
My PHP version is: 7.4
My Database type and version is: tidb

Your problem

I am trying to create a mjml-based theme. When I upload my theme, it complains that ‘email.html.twig’ is missing. So i rename email.mjml.twig to email.html.twig.

I look at a sample (GitHub - mautic/theme-brienz), i see email.mjml.twig, so i think i did it properly.

I look at this PR:

and try renaming to email.html.twig (w/ mjml inside), and it uploads ok, shows on the themes list, but, when i compose an email is not present.

Am i supposed to use email.mjml.twig or email.html.twig. What pre-requesites do I need on the server to make tis work? the brienz theme seems to function so i assume all are present.

Just copy your email.mjml.twig to email.html.twig and upload the archive. Will be okay.

ok. but the samples etc don’t have this:

which makes them somewhat non-functional right now. Is this the intent?

Here is the thing.
Examples don’t have it because they are not uploaded via the UI.
I just checked it: the bug still exists in M4. You can’t upload via the UI if you don’t have the email.html.twig. This file was needed earlier for templates to work.
My money is on /app/Bundles/CoreBundle/Helper/ThemeHelper.php:469. But an actual coder should take a look.

According to the PR you mentioned, you add the MJML to the existing file (or duplicate it and rename it). Ideally we should be able to upload MJML only themes, this was suggested as a workaround to make it easier for users.

Have you tried with the MJML file and the regular one with the same content?

As a simpler workaround just add the theme to the folder on the server rather than uploading. Would be good to address it though and allow both to be uploaded without the cludgy workaround in the longer term, I think, as most end-users are likely to use the upload (plus if you download / upload a modified theme, also more likely to use the user interface I would expect.