Email customization in PrestaShop is essential to deliver a consistent and professional customer experience. In this guide, we will look at how to translate and edit email templates using the override system in the folder of the theme in use (e.g., a child theme), how to manage form-related emails, and why it is beneficial to use this strategy.

1. Where to find email files in PrestaShop

In PrestaShop, email templates are usually located in the folder:

[code=language-bash] /mails/ [/code]

This directory contains email files in .html (graphics version) and .txt (text-only version) format. Both versions are needed to ensure compatibility with all mail clients, as some users or devices may prefer or support only the text version.

2. Form-related emails

Some email templates are not located in the main /mails/ directory, but are specific to certain modules. For example, the ps_emailalerts module uses the email files located in:

[code=language-bash] /modules/ps_emailalerts/mails/ [/code]

These files can still be overwritten without directly modifying the original module files. To do this, an override structure must be created in the folder of the theme in use:

[code=language-bash] /themes/your_theme/modules/ps_emailalerts/mails/ [/code]

By copying the files from the module directory to this location, you can customize them without the risk of them being overwritten during module updates.

3. Why to prefer override

The use of overrides is a recommended practice for several reasons:

  • Retention of changes: Customizations are not lost during PrestaShop or module updates.

  • Ease of management: Changes are organized within the theme in use, making it easier to locate and edit custom files.

4. Translating email files

Email files are written in HTML (for the graphic version) and plain text (for the text version). To translate or customize the content, simply open the files with a text editor and edit the text while keeping the HTML tags and PrestaShop variables intact, such as

{shop_name} o {firstname} .

Using ChatGPT for translations

A quick and effective way to translate email files is to use artificial intelligence tools such as ChatGPT. Here's how to do it:

  1. Copy the contents of the .html or .txt file.

  2. Paste it into ChatGPT and ask for a translation, specifying the target language.

  3. Verify that HTML tags and variables are left intact in the translation.

  4. Paste the translated text into the corresponding file in the theme's override folder.

5. Override structure for email templates

To apply the changes to your current theme, follow these steps:

(a) Locate the file to be translated:

For example, if you want to translate the email "order_conf.html" found in /mails/en/, copy the file to the override directory of the theme in use:

[code=language-bash] /themes/your_theme/mails/en/order_conf.html/themes/your_theme/mails/en/order_conf.txt [/code]

(b) Edit and translate the file:

Open the .html and .txt files with a text editor or IDE and apply the translation.

(c) Test the changes:

After translating and saving the files, send a test email to verify that the contents are correct and display well

6. Conclusions

Translating and customizing emails in PrestaShop is a simple but important process for maintaining clear and professional communication with customers. Using overrides in the current theme folder allows you to:

  • Preserve changes during updates.

  • Centralize customizations.

In addition, leveraging tools such as ChatGPT for translations can simplify the work and reduce the time it takes to adapt emails to different languages.

By following this guide, you will be able to manage your PrestaShop store's emails efficiently and professionally.

Author: Loris Modena

Loris Modena

SENIOR DEVELOPER

Per Ind Loris Modena owner of Arte e Informatica, began working in the computer industry in 1989 as a systems engineer in charge of maintenance and installation of computer systems. He starts programming for the web in 1997 dealing with CGI programming in PERL and later moving to programming in PHP and JavaScript. During this period he approaches the Open source world and Linux server management.

Product added to wishlist