Documentation You are here: start » v » 2.0 » i18n

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
v:2.0:i18n [2016/10/08 09:47] – [Customising the email subject] adamv:2.0:i18n [2019/05/04 03:44] (current) – [Customising the email subject] adam
Line 29: Line 29:
 ==== Customising the email subject ==== ==== Customising the email subject ====
  
-Currently the email subject sent out with the email receipt is not a language string, but is set on the emails template page directly. If you want to customise this based on the language set for the cart, you'll need to include a little Twig logic in your email template. Paste the following at the top of your email templates (both the text and HTML versions if you're using both options), and customise it to cover the languages that you're supporting in your template sets:+Currently the email subject sent out with the email receipt is not a language string, but is set on the emails template page directly. The exception to this is for our subscription dunning functionality, which is set as part of the language settings, specifically the ''email subject subscription cancelled'', ''email subject subscription past due'' and ''email subject expiring payment reminder'' strings. 
 + 
 +If you want to customise the email subject based on the language set for the cart, you'll need to include a little Twig logic in your email template. The following is an example of that for updating just the email subject for the email receipt (and not the subscription dunning emails). Paste the following at the top of your email templates (both the text and HTML versions if you're using both options), and customise it to cover the languages that you're supporting in your template sets:
  
 <code>{% set custom_subject = "" %} <code>{% set custom_subject = "" %}
-{% if language == "german" %} +{% if not is_subscription_dunning_cancellation and not is_subscription_dunning_reminder and not is_expiring_payment_reminder %} 
- {% set custom_subject = "German Email Subject Line" %} + {% if language == "german" %} 
-{% elseif language == "french" %} + {% set custom_subject = "German Email Subject Line" %} 
- {% set custom_subject = "French Email Subject Line" %}+ {% elseif language == "french" %} 
 + {% set custom_subject = "French Email Subject Line" %} 
 + {% endif %}
 {% endif %} {% endif %}
 {% if custom_subject != "" %} {% if custom_subject != "" %}
- {{ email_subject|fc_output_data('custom_subject') }}+ {{ custom_subject|fc_output_data('email_subject') }}
 {% endif %}</code> {% endif %}</code>
  

Site Tools