Jump to content

Email Template not generated


Recommended Posts

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

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 :-)

  • Like 1
Link to comment
Share on other sites

  • 4 months later...
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 by jerem_ (see edit history)
  • Haha 1
Link to comment
Share on other sites

  • 2 years later...
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...