• Hi,

    I’ve added a custom email and would like to have it in two languages. I’ve tried to use this code
    [wcj_wpml lang="PL"]Twój numer przesyłki to: [wcj_order_metameta_key=”ywot_tracking_code”][/wcj_wpml]
    [wcj_wpml lang="EN"]Tracking number: [wcj_order_metameta_key=”ywot_tracking_code”][/wcj_wpml]

    but none of these messages are displayed in the email (for orders made both from polish and english version of my site). Anyone have ideas how to fix it? 🙂

    Best regards,
    Kuba

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    As emails are created on server side, it’s impossible to know the language of the client. There is however another possibility – to display language depending on billing country of current order. For that you need to add billing_country and not_billing_country attributes to shortcodes, something like this (example is from http://booster.io/multilanguage-pdf-invoice-example/):

    [wcj_text billing_country="FR,BE"]Facture[/wcj_text]
    [wcj_text billing_country="DE"]Rechnung[/wcj_text]
    [wcj_text not_billing_country="FR,BE,DE"]Invoice[/wcj_text]
    
    [wcj_order_number billing_country="FR,BE" before="Numéro de commande: "]
    [wcj_order_number billing_country="DE" before="Bestellnummer: "]
    [wcj_order_number not_billing_country="FR,BE,DE" before="Order number: "]

    Please let me know if that helped.

    Best regards,
    Tom

    P.S. If you like Booster, please leave us a rating.

    • This reply was modified 9 years, 4 months ago by Algoritmika.
    • This reply was modified 9 years, 4 months ago by Algoritmika.
    Thread Starter bindebale

    (@bindebale)

    Hi,

    Thanks for t=your quick answer. Will try this. However, I’ve managed to have translated emails in English. Unfortunately, there is no polish version 🙁

    Hi,

    Could you please post here (or send it to [email protected]) the code which you are using?

    Best regards,
    Tom

    Thread Starter bindebale

    (@bindebale)

    Hi,

    Here is the code:

    [wcj_wpml_translate lang="pl"]Twoje zamówienie zostało już wysłane! Niedługo będziesz mogła cieszyć się nim w domu.[/wcj_wpml_translate]
    [wcj_wpml_translate lang="en"]Your order has been shipped! You will receive it soon.[/wcj_wpml_translate]

    Hi,

    As I mentioned earlier, you can’t use lang attribute in emails, as emails are created on server, so it’s always the same language there. However please try this:

    [wcj_text billing_country="PL"]Twoje zamówienie zostało już wysłane! Niedługo będziesz mogła cieszyć się nim w domu.[/wcj_text]
    [wcj_text not_billing_country="PL"]Your order has been shipped! You will receive it soon.[/wcj_text]

    Best regards,
    Tom

    Thread Starter bindebale

    (@bindebale)

    Thanks, I will try this one 🙂

    Thread Starter bindebale

    (@bindebale)

    Hi,

    I’ve tried this code for orders from Poland, Germany and United Kingdom, however all emails were sent in English. 🙁

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Translating custom email’ is closed to new replies.