theodiablo Posted August 31, 2020 Share Posted August 31, 2020 Hi, I am trying to develop a new email theme. To do so, I created a new module as suggested here: https://devdocs.prestashop.com/1.7/modules/concepts/mail-templates/add-a-theme-from-module/ So far, so good, I manage to have the new theme appearing in the "Email Theme" menu. The thing is that when I generate the emails, nothing changes and I keep seeing the previous emails of the "modern" template. Here is my folders structure: / mails /* The original Prestashop emails & templates */ | en | es | themes | | classic | | | ... | | modern | | | ... modules | my-module /* The module where I have created my new custom theme */ | | mails | | themes | | | my-theme /* The new email template */ | | | | core | | | | ... /* All template files & folders */ themes | my-theme /* My custom FO theme where I have set my-module as dependency */ | | mails (empty) When I generate the emails, they are generated in the "themes > my-theme > mails" folder, however there are generated with the original "modern" template. I tried several things, generate the emails with core theme, then with "my-theme" theme, then overriding templates, clearing cache... I tried everything but it still takes the old templates. Any idea what I might be doing wrong? Link to comment Share on other sites More sharing options...
theodiablo Posted September 1, 2020 Author Share Posted September 1, 2020 I found the answer to my problem... In the core email templates, there were: {% extends '@MailThemes/modern/components/layout.html.twig' %} {% extends '@MailThemes/modern/components/layout.html.twig' %} Changing this to my theme solved this issue... Thanks anyway :-) 1 Link to comment Share on other sites More sharing options...
jerem_ Posted January 21, 2021 Share Posted January 21, 2021 (edited) On 9/1/2020 at 10:18 AM, theodiablo said: I found the answer to my problem... In the core email templates, there were: {% extends '@MailThemes/modern/components/layout.html.twig' %} {% extends '@MailThemes/modern/components/layout.html.twig' %} Changing this to my theme solved this issue... Thanks anyway 🙂 Wow, thanks a lot ! My brain was about to crash until i find your post... That's exactly what i was looking for ! Edit : Well, it did the job once.... then i changed something else in my layout and it's no longer working when i generate the emails... Aaaaand that's ok now... i had to clear the cache from Ps... I've no cache activated in the Presta conf but it seems there's always some cache somewhere... Edited January 21, 2021 by jerem_ (see edit history) 1 Link to comment Share on other sites More sharing options...
valousal Posted July 3, 2023 Share Posted July 3, 2023 On 9/1/2020 at 10:18 AM, theodiablo said: I found the answer to my problem... In the core email templates, there were: {% extends '@MailThemes/modern/components/layout.html.twig' %} {% extends '@MailThemes/modern/components/layout.html.twig' %} Changing this to my theme solved this issue... Thanks anyway :-) Hi @theodiablo, I got the same error but I couldn't solve the problem. Here is the error generated by PrestaShop. Cannot generate email templates for theme mytheme with locale fr Could not find layout file: @MailThemes\mytheme\core\fabrication.twig In the core email templates, there is: {# modules/mytheme/mails/themes/mytheme/core/fabrication.html.twig #} {% extends '@Modules/mytheme/mails/themes/mytheme/components/layout.html.twig' %} Do you have an idea ? Thanks, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now