Blog navigation keyboard_arrow_down

Blog Rss rss_feed

How to Safely Edit and Save Email Templates in PrestaShop Without Losing Changes

How to Safely Edit and Save Email Templates in PrestaShop Without Losing Changes

PrestaShop’s email notification system offers extensive options for customizing the messages sent to store customers. Each time a customer takes action – such as registering, placing an order, or changing an order status – they receive an email notification. These messages support communication with the customer and allow each store to define its own unique style and tone.

However, many administrators face a challenge: how to save changes to email templates so that they’re not lost after a platform update. In this article, we’ll explore how to properly edit and save email templates in PrestaShop using built-in tools and manual file editing. By following these steps, you can ensure your customizations are safe.

Methods for Editing Email Templates in PrestaShop

There are two main methods to edit email templates: through the PrestaShop admin panel and directly in the file system.

1. Editing Email Templates through the Admin Panel

This method is ideal for administrators who may not have experience with the file system or code. PrestaShop provides a straightforward interface where you can edit email templates using a visual editor.

To edit an email template through the admin panel:

  1. Log into your PrestaShop admin panel.
  2. Go to International > Translations.
  3. In the Modify Translations section, select the translation type Email.
  4. Choose the language of the templates you want to edit.

Let’s take, for example, the order confirmation template, which is sent to customers after they complete a purchase. This template is called “order_conf”.

  1. Locate the “order_conf” template and make your edits in the visual editor.
  2. Save your changes. PrestaShop will automatically create a file in the theme or module directory (in the path themes/your_theme/mails/language/order_conf.html), allowing the changes to persist during updates.

This approach does not require coding knowledge, although it might be limited in terms of customization options.

2. Manually Editing Templates in the File System

For more advanced administrators comfortable with code and the file system, PrestaShop allows direct editing of templates in the file structure.

To edit templates in the file system:

  1. In the root PrestaShop directory, locate the /mails/language/ folder, where original email templates are stored. For example, the order confirmation template is named “order_conf.html”.

  2. Copy this file to your theme folder in the path /themes/your_theme/mails/language/order_conf.html.

    Important: By placing the template in the theme folder, you override the default template, ensuring that updates do not affect your customizations.

  3. Open the copied file and make the necessary modifications.

  4. Save your changes, and PrestaShop will now use this customized file, bypassing the default template so that your edits remain even after updates.

Overriding Email Templates for Modules

If you need to modify an email template from a module, follow the same method:

  1. Locate the original template in the module’s /modules/module_name/mails/language/template.html folder.

  2. Copy the file to your theme folder, using the same structure.

    Example path: /themes/your_theme/modules/module_name/mails/language/template.html.

This allows you to fully customize any email notification without risking loss of changes during updates.

PrestaShop provides flexible and powerful tools for working with email templates. By following the instructions above, you can tailor templates to your store’s unique style. Remember that changes made through the admin panel are saved to the theme or module directory, while manual edits must be placed in the correct theme folder to avoid being overwritten by updates.

Share in the comments: did you know about this method of overriding templates, and do you use it for your store?

Was this blog post helpful to you?

    
No comments at this moment
close

Checkout

close

Favourites