# Plugin Woocommerce: Translate all email sent to customers

Version 3.1.7 of the **Weglot WordPress plugin** introduces a new feature that allows you to **translate all Woocommerce emails related to an order sent to customers**.

When an order is created, the language of the user is then recorded in the meta data of the order concerned (the language is not saved if the order is created from the original language of the site). When a Woocommerce email is then sent to a customer and it concerns an order, this email will then be translated if the order is linked to a language.

To work, you must also have activated the '**translate mail**' option in the Weglot plugin options page.

This feature is disabled by default in this version. Here are 2 methods to activate this feature.&#x20;

### Method 1: Custom Plugin&#x20;

To activate this feature, you can create PHP file named "**weglot-wooccommerce-translate-following-mail.php**" in your plugins directory (`wp-content/plugins/`) with this content :&#x20;

```php
<?php
/**
 * Plugin Name: Weglot - Wooccommerce translate following mail
 * Plugin URI: weglot.com
 * Description: Use weglot to translate all Woocommerce emails related to an order sent to customers.
 * Author: Weglot Team
 */

add_filter( 'weglot_woocommerce_translate_following_mail', '__return_true' );

```

Then, go to your WordPress plugin option page and activate the plugin "**Weglot - Woocommerce translate following mail**".&#x20;

### Method 2: Plugin Code Snippets&#x20;

You can add and activate the plugin code snippets (<https://fr.wordpress.org/plugins/code-snippets/>) and use it to add the following filter :&#x20;

```php
<?php
add_filter( 'weglot_woocommerce_translate_following_mail', '__return_true' );

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.weglot.com/wordpress/use-cases/translation-of-woocommerce-emails-sent-to-customers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
