Jump to content

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?

Share this post


Link to post
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

Share this post


Link to post
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)

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More