Jump to content

[SOLVED]Custom Email Templates Ignored in Order Status Preview (PS 9)


ptityop

Recommended Posts

I’m having a very confusing issue with email templates in PrestaShop 9, specifically when using the email preview from the “Order status” section in the Back Office.

When I started testing email previews, I noticed that the templates being rendered were not the ones I had customized. Because PrestaShop 9 introduced many changes compared to previous versions, I assumed this might be related to how email templates are now resolved.

To eliminate ambiguity, I took the following steps:

- I copied all email templates from the custom theme/mails folder into both the classic and modern themes.
- I then tested which location was actually being used by the preview system.

Through testing, I realized that:

- The email preview only works when /mails/themes/classic exists.
- If I rename or remove /mails/themes/classic, the email preview stops working entirely.

This strongly suggests that /mails/themes/classic is the only folder triggering email previews.

To further isolate the issue:

In my custom theme, I renamed the mails folder so it cannot be used.

In the core /themes directory, I renamed all themes except classic, so there should be only one possible source for email templates: /mails/themes/classic

Despite this, I’m still seeing generic email content in the preview, The main email body does not reflect my customized templates from the language folder, However, changes made to footer.twig are reflected (for example, removing “Powered by PrestaShop”). So something is being loaded from my customized files — but only partially.

Also.

I clear the cache every time I make changes (manually from the file manager) , I have left only one language folder inside /mails/themes/classic, even so, the email body content does not seem to come from that language folder at all.

At this point, I’m stuck because:

There is only one possible mail template location left.
Parts of my customizations are applied.
But the main email content is still coming from what looks like a fallback or generic source.

Clearly, I’m missing something in how PrestaShop 9 resolves or composes email templates, but I can’t identify what it is.

If anything in this explanation is unclear, I’m happy to reformulate — but I hope someone familiar with PrestaShop 9’s email system can point out what I’m overlooking.

Edited by ptityop (see edit history)
Link to comment
Share on other sites

  • ptityop changed the title to Custom Email Templates Ignored in Order Status Preview (PS 9)

Hi,

In PrestaShop 9 the “Order status” email preview isn’t driven only by the old /mails/en/*.html files anymore. It uses the Twig email theme system, so it’s normal that footer.twig changes show up (Twig layout), while the main body still looks generic if you’re editing the wrong layer.

What to do:

  • BO → Design > Email theme: select your email theme and click Generate.
  • Edit the Twig templates in /mails/themes/classic/ (templates/layouts/components), not just the language folder.
  • Clear cache.

And yes, preview breaking when /mails/themes/classic is missing looks like a fallback/bug, keep that folder.

Edited by wepresta (see edit history)
  • Like 2
Link to comment
Share on other sites

9 hours ago, ptityop said:

I’m having a very confusing issue with email templates in PrestaShop 9, specifically when using the email preview from the “Order status” section in the Back Office.

When I started testing email previews, I noticed that the templates being rendered were not the ones I had customized. Because PrestaShop 9 introduced many changes compared to previous versions, I assumed this might be related to how email templates are now resolved.

To eliminate ambiguity, I took the following steps:

- I copied all email templates from the custom theme/mails folder into both the classic and modern themes.
- I then tested which location was actually being used by the preview system.

Through testing, I realized that:

- The email preview only works when /mails/themes/classic exists.
- If I rename or remove /mails/themes/classic, the email preview stops working entirely.

This strongly suggests that /mails/themes/classic is the only folder triggering email previews.

To further isolate the issue:

In my custom theme, I renamed the mails folder so it cannot be used.

In the core /themes directory, I renamed all themes except classic, so there should be only one possible source for email templates: /mails/themes/classic

Despite this, I’m still seeing generic email content in the preview, The main email body does not reflect my customized templates from the language folder, However, changes made to footer.twig are reflected (for example, removing “Powered by PrestaShop”). So something is being loaded from my customized files — but only partially.

Also.

I clear the cache every time I make changes (manually from the file manager) , I have left only one language folder inside /mails/themes/classic, even so, the email body content does not seem to come from that language folder at all.

At this point, I’m stuck because:

There is only one possible mail template location left.
Parts of my customizations are applied.
But the main email content is still coming from what looks like a fallback or generic source.

Clearly, I’m missing something in how PrestaShop 9 resolves or composes email templates, but I can’t identify what it is.

If anything in this explanation is unclear, I’m happy to reformulate — but I hope someone familiar with PrestaShop 9’s email system can point out what I’m overlooking.

In PrestaShop 9, the order status email preview does not use your theme’s custom email templates.
The preview pulls emails from the core fallback location, not from overridden theme folders.
This is expected behavior and does not reflect what customers actually receive.
Actual emails sent to customers will still use the correct theme and language templates.
The preview tool is mainly for basic testing, not full template validation.

  • Like 2
Link to comment
Share on other sites

Thanks all for your replies,by miracle i finally got things sending right template but still makes no sense, still trying to work out where the info is being pulled out from. So as test I tried to modify the order_conf.txt, just adding some dummy text that should show up even in the admin preview. So here are all the paths I have tried 

/mails/fr/order_conf.txt (i know this should not exist but i tried just in case)
/mails/themes/classic/mails/fr/order_conf.txt

/mails/themes/MyCustomTheme/mails/fr/order_conf.txt
/themes/MyCustomTheme/mails/fr/order_conf.txt

Cleared cache and refreshed after each change, why the hell I am not seeing the changes yet ... driving me mad 🙂

Is there some cache to be cleared in the admin ? Because i see that when I preview the url is adminxxxx/improve/design/mail_theme/preview/classic

Edited by ptityop (see edit history)
Link to comment
Share on other sites

10 hours ago, ptityop said:

Thanks all for your replies,by miracle i finally got things sending right template but still makes no sense, still trying to work out where the info is being pulled out from. So as test I tried to modify the order_conf.txt, just adding some dummy text that should show up even in the admin preview. So here are all the paths I have tried 

/mails/fr/order_conf.txt (i know this should not exist but i tried just in case)
/mails/themes/classic/mails/fr/order_conf.txt

/mails/themes/MyCustomTheme/mails/fr/order_conf.txt
/themes/MyCustomTheme/mails/fr/order_conf.txt

Cleared cache and refreshed after each change, why the hell I am not seeing the changes yet ... driving me mad 🙂

Is there some cache to be cleared in the admin ? Because i see that when I preview the url is adminxxxx/improve/design/mail_theme/preview/classic

Because your preview URL is .../mail_theme/preview/classic, you’re previewing the Twig email theme “classic”, not the legacy /mails/fr/order_conf.txt. So editing order_conf.txt won’t show up there.

Do this:

  • Edit the Twig template under /mails/themes/classic/ (not /mails/fr/).
  • BO → Design → Email theme → Generate (for your language).
  • Delete /var/cache/* and refresh.

There isn’t a separate “admin cache” for this beyond regenerating + clearing /var/cache.

  • Like 1
Link to comment
Share on other sites

On 1/5/2026 at 9:37 AM, wepresta said:

Hi,

In PrestaShop 9 the “Order status” email preview isn’t driven only by the old /mails/en/*.html files anymore. It uses the Twig email theme system, so it’s normal that footer.twig changes show up (Twig layout), while the main body still looks generic if you’re editing the wrong layer.

What to do:

  • BO → Design > Email theme: select your email theme and click Generate.
  • Edit the Twig templates in /mails/themes/classic/ (templates/layouts/components), not just the language folder.
  • Clear cache.

And yes, preview breaking when /mails/themes/classic is missing looks like a fallback/bug, keep that folder.

I am  not sure what I should be editing there ? Just to make sure, in this folder there should only be footer, header, layout and order_layout right or all the mail templates should go there ? I am really sorry if I look that confused 🙂

Link to comment
Share on other sites

1 minute ago, ptityop said:

I am  not sure what I should be editing there ? Just to make sure, in this folder there should only be footer, header, layout and order_layout right or all the mail templates should go there ? I am really sorry if I look that confused 🙂

No worries, in PS9 it’s not only header/footer/layout.

Inside /mails/themes/classic/ you should have:

  • layouts (header/footer/base layout)
  • components (small reusable blocks)
  • templates (the actual email bodies, e.g. order confirmation)

So for your case you need to edit the order confirmation Twig template under something like:
/mails/themes/classic/templates/… (name varies by PS version, but it’s the one for order confirmation).

Important: after editing, go to BO → Design → Email theme → Generate (for your language), then clear /var/cache/*

Link to comment
Share on other sites

Again thanks for your patience this is driving me mad, so here is exactely what I have , just trying to make it simple. So I am using my custom template and I have all my mails in 

/themes/ZOneTheme/mails/fr in there I have all the .txt and .html templates

In BO In Parameters I chose my default email template selecting my custom theme

Then i generate email (but here I am not to sure what to select in the option (overwrite theme) 

I clear cache every change I make

And still no luck 

Link to comment
Share on other sites

4 minutes ago, ptityop said:

Again thanks for your patience this is driving me mad, so here is exactely what I have , just trying to make it simple. So I am using my custom template and I have all my mails in 

/themes/ZOneTheme/mails/fr in there I have all the .txt and .html templates

In BO In Parameters I chose my default email template selecting my custom theme

Then i generate email (but here I am not to sure what to select in the option (overwrite theme) 

I clear cache every change I make

And still no luck 

I see the confusion: in PS9, /themes/ZOneTheme/mails/fr (.html/.txt) is the legacy system. The BO email preview and the PS9 mail system mainly use the Twig email themes under /mails/themes/....

So if you only edit:
/themes/ZOneTheme/mails/fr/*.html
you often won’t see it in the PS9 preview.

Do this instead:

  • BO → Design → Email theme
    • Select your email theme, then click Generate.
  • In “Overwrite theme”:
    • Choose YES if you want PrestaShop to rebuild the theme files under /mails/themes/<your_theme>/... from the current source.
    • Choose NO if you already edited Twig files there and don’t want them overwritten.
  • After generating, edit the real files used by preview:
    • /mails/themes/<selected_theme>/templates/... (order confirmation template and clear /var/cache/*.

Quick test: open the preview URL — it shows .../preview/classic or .../preview/<your_theme>. That name must match the folder inside /mails/themes/. If it says classic, you’re not previewing your custom theme yet.

If you paste:

  • the preview URL (classic or your theme name)
  • the folder list under /mails/themes/

I can tell you exactly which template file to edit.

Edited by wepresta (see edit history)
Link to comment
Share on other sites

So, when I preview the emails from the BO , under the classic I can see the names of my custom templates , but when I look at the email preview  from my custom theme (improve/design/mail_theme/preview/ZOneTheme). I see a completely different list, lots of different files and none of my custom templates, i might have broken a logic on the way fiddling around that much. Firs screenshot shows the list of my actual email templates, the ones I want to use and that are also present in my theme/mails folder. The url I get from previewing one of those file is And this is the url i get from previewing is improve/design/mail_theme/raw/fr-FR/ZOneTheme/ps_specials/index.txt

My theme mails folder only contains the language folder  themes/ZOneTheme/mails, maybe something else should be goind there ? 

Actually are my .txt and .html files any useful at all ?

image.thumb.png.3322aa04f79fafae0c9e186f638b3636.png

image.thumb.png.e0dd2e45dd9de6a5742d319544064edb.png

Edited by ptityop (see edit history)
Link to comment
Share on other sites

You didn’t break anythin, it’s just two different systems in PS9.

  • /themes/ZOneTheme/mails/fr/*.html/.txt = legacy “raw” emails (old system).
  • BO preview URLs like .../mail_theme/preview/... = Twig email themes, loaded from /mails/themes/<theme>/.

In your screenshot, ZOneTheme only shows index for ps_specials because BO is only finding a module raw template there, you don’t have a real Twig mail theme generated for ZOneTheme, so it can’t list/order-preview order_conf, order_ship, etc.

What you should do:

  • Create the Twig mail theme folder:
    • easiest: copy /mails/themes/classic → /mails/themes/ZOneTheme (or BO → Design → Email theme → select ZOneTheme → Generate with overwrite = YES)
  • Clear cache: delete /var/cache/*
  • Now edit the actual Twig email body, not .txt/.html: /mails/themes/ZOneTheme/templates/... (order confirmation template)

After that, the preview should match your edits.

Edited by wepresta (see edit history)
  • Like 1
Link to comment
Share on other sites

  • ptityop changed the title to [SOLVED]Custom Email Templates Ignored in Order Status Preview (PS 9)

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...