Customize Email Content by Language

Modified on Tue, 27 May at 8:33 AM

If your Shopify store serves customers in multiple languages, you might want to send localized email notifications when fulfilling digital product orders through FetchApp. While FetchApp currently does not support multiple email templates within a single account, you can implement conditional logic within your template using Liquid to dynamically adjust content based on order data.


Language Detection

By using Shopify order note attributes or billing address country codes, you can infer the customer's language and customize your email content accordingly.


Add this at the start of the email template to detect the language:

{% assign invoice_language_parts = order.api_data.note_attributes["Invoice Language"] | split: '-' %}
{% assign invoice_language = invoice_language_parts.last | downcase | strip %}
{% assign billing_country = order.api_data.billing_address.country_code | downcase | strip %}
{% assign languages = 'en,de,fr,es,it,tr,pt,at,ch,lu,be,nl' | split: ',' %}

{% for lang in languages %}
  {% if lang == invoice_language %}
    {% assign language = lang %}
    {% assign lang_found = true %}
    {% continue %}
  {% endif %}
  {% if lang == billing_country and lang_found != true %}
    {% assign language = lang %}
    {% continue %}
  {% endif %}
{% endfor %}
{% if language == blank %}
  {% assign language = 'en' %}
{% endif %}
HTML

This logic prioritizes the Invoice Language note attribute, and falls back to the billing country if a matching language isn’t found.


Displaying Text Based on Language

Once the language is determined, you can dynamically render different content to suit the detected language:


{% if language == 'en' %}
  ...ENGLISH CONTENT
{% elsif language == 'de' %}
  ...GERMAN CONTENT
{% elsif language == 'pt' %}
  ...PORTUGUESE CONTENT
{% endif %}
HTML

You can expand this logic for as many languages as needed.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article