less than a minute read • Updated an hour ago
Customize the email subject by language
How to use Twig logic in your email templates to set a different email receipt subject line based on the cart's language.
By default, the email receipt’s subject line is set directly on the email template page and isn’t tied to a language string — but you can add Twig logic to your email templates to vary the subject based on the cart’s language.
How it works
The email subject is not itself a language string, with one exception: subscription dunning emails, where the subject is controlled by the language settings using these strings:
email subject subscription cancelledemail subject subscription past dueemail subject expiring payment reminder
For the standard email receipt (not dunning emails), you customize the subject per language by adding Twig logic to the top of your email templates.
Steps
{% set custom_subject = "" %}
{% if not is_subscription_dunning_cancellation and not is_subscription_dunning_reminder and not is_expiring_payment_reminder %}
{% if language == "german" %}
{% set custom_subject = "German Email Subject Line" %}
{% elseif language == "french" %}
{% set custom_subject = "French Email Subject Line" %}
{% endif %}
{% endif %}
{% if custom_subject != "" %}
{{ custom_subject|fc_output_data('email_subject') }}
{% endif %}
Notes
If none of the conditions match — for example, the cart’s language doesn’t have a custom subject defined — Foxy falls back to the default subject set in your store’s admin.
This snippet intentionally excludes subscription dunning emails, since those use their own subject language strings rather than the email template’s subject field.
The same approach can be used to customize the bcc and from addresses per language.