Troubleshooting Mautic 5 Theme Compatibility

Your software
My Mautic version is: 5.0-alpha1
My PHP version is: 8.0.2

Your problem
I am in the process of making my current email templates compatible with Mautic 5. However, I’m aware that the paths are different for Mautic 5, and the version 4 doesn’t work with the newest Mautic versions that will be released. For example:

Mautic 4 (theme/html/message.html.twig)
{% extends ":"~template~":base.html.twig" %}

Mautic 5 (theme/html/message.html.twig)
{% extends "@themes/"~template~"/html/base.html.twig" %}

I would like to know how the paths work for email.html.twig in Mautic 5. For Mautic 4:
<mj-image src="{{getAssetUrl('themes/'~template~'/assets/logo.png')}}" width="300px" align="left" />

I need to correct the paths for the content folders. Since there is no documentation available, it’s been challenging to find a solution. I’ve conducted some tests but haven’t found the solution yet. If someone could assist me, I would greatly appreciate it.

Thank you very much,
Ricardo

I’m not aware of any changes needed for templates. Those used Twig even in M4. Can you describe what is the problem? Is it returning wrong path? What path is it? Are the core themes not working?

Hi @escopecz

Thank you for your feedback. I encountered an issue when trying to use my Mautic 4 email templates with Mautic 5. Initially, the paths weren’t functioning properly. However, with the assistance of @lenonleite, we managed to rectify the issue with the message.html.twig file.

Currently, I’m facing a problem where the images paths are recognized by the builder, and even display correctly in the preview. However, when the email is sent, the images fail to appear. This is exemplified by the following:

Broken image paths on the email sent

It doesn’t show any errors in the logs or anything. If you’re suggesting that it should work fine with the themes, could this be a bug?

Thanks,
Ricardo

Hello again,

I apologize for the previous confusion and inconvenience. Actually the native email templates are functioning as expected during sending. Additionally, when I used the same path as the Paprika theme for my custom themes, it successfully rendered the images. Here’s the code snippet I employed for reference:

src="{{ getAssetUrl('themes/'~template~'/assets/editor.png', null, null, true) }}"

Thanks for the help once again,
Ricardo

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.