Shopify – Translate your Shopify email notifications
ConveyThis automatically handles translations for website content. Emails, being outside the website’s scope, aren’t automatically translated by ConveyThis. But, using ConveyThis combined with liquid code, you can manually control email content translations based on the order’s language.
Keep in mind, this method applies to order notifications, but not the Gift Card Creation alert.
Before diving in, understand that various notification types exist, and the approach varies slightly for each:
Open a text editor of your choice and paste the following liquid code!
Fire up your preferred text editor and drop in the given liquid code. Tailor the code to the languages your site speaks. Adjust the ‘when’ lines by setting the right language codes.
Imagine your site using ConveyThis: English sets the tone, while French and Spanish dance in as your chosen translated languages. Here’s a glimpse of how the liquid structure would look:
{% case attributes.lang %}
{% when 'fr' %}
EMAIL EN FRANÇAIS ICI
{% when 'es' %}
EMAIL EN ESPAÑOL AQUI
{% else %}
EMAIL IN THE ORIGINAL LANGUAGE HERE
{% endcase %}
//----------
{% case attributes.lang %}
{% when 'de' %}
EMAIL IN DEUTSCH HIER
{% else %}
EMAIL IN THE ORIGINAL LANGUAGE HERE
{% endcase %}
The title translates to Perfecting Your Email Translations: A Guide for German
Remember, the provided code is just a blueprint. Tailor it to fit the languages you’ve handpicked in your ConveyThis dashboard for that personalized email translation touch.
Eyeing a German-only email translation? Here’s a sample to guide you:
The title translates to Coding with Language Preferences in Mind: How to Adapt Content for German Speakers and Others
If an order is placed in German, the customer will be greeted with content nestled between the ‘de’ and ‘else’ code lines. But, if they’ve chosen a different dance partner than German, they’ll be serenaded with the content found between the ‘else’ and ‘endcase’ code lines.
In your Shopify admin area, go to Settings > Notifications and open the email you would like to translate!
In the heart of your Shopify dashboard, sail to Settings > Notifications and anchor down on the email craving a translation touch. Dreaming of a multilingual ‘Order Confirmation’ email? Here’s your compass:
Copy the email body!
Return to your text editor and swap out ‘EMAIL IN THE ORIGINAL LANGUAGE HERE’ with the code you’ve copied (assuming English is your primary language)
In this instance, since English is the primary language, the placeholder ‘EMAIL IN THE ORIGINAL LANGUAGE HERE’ has been substituted with the code.
Swap out ‘EMAIL EN FRANÇAIS ICI’ with the provided code and adjust the phrases to their translated versions. Repeat for other languages such as ‘EMAIL EN ESPAÑOL AQUI’
For example, for French, you will change ‘Thank you for your purchase!’ by ‘Merci pour votre achat!’. Make sure you only alter the sentences. You must not translate any liquid code in between {% %} or {{ }}
After updating all the fields for each language, copy the entire content from your text editor and insert it under Shopify admin > Notifications, in the desired notification to modify
In this case, the email edited is ‘Order Confirmation’:
Follow the same procedure for the email’s subject
For the email subject, the process is identical: In your text editor, copy the code, then substitute the fields with the translated subject, as demonstrated here:
For the email subject, the process is identical: In your text editor, copy the code, then substitute the fields with the translated subject, as demonstrated here:
Hit the ‘Save’ button located at the upper right corner
You’re done! Your customer should receive the email in their language.
Notifications for Customers
To customize email notifications for your customers, you can integrate a lang tag in the ‘Customers’ section of your Shopify admin > Customers. This tag will reflect the language chosen by the visitor when registering on your site.
To activate this capability, insert the line customer_tag: true
into the ConveyThis code. Navigate to your Shopify admin > Online Store > Themes > Actions > Edit Code > ConveyThis_switcher.liquid to make this adjustment.
<!-- ConveyThis: https://www.conveythis.com/ -->
<script src="//cdn.conveythis.com/javascript/conveythis-initializer.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(e) {
ConveyThis_Initializer.init({
api_key: "pub_********************"
});
});
</script>
After integrating this tag into the code, you can structure the customer notification based on the previously discussed format:
The approach remains the same as outlined in the initial section of this guide, but employ the following code:
{% assign language = customer.tags | join: '' | split: '#conveythis-wrapper' %}
{% case language[1] %}
{% when 'en' %}
English account confirmation
{% else %}
Original Customer account confirmation
{% endcase %}