From 6823d1dcceffd980d5e6d7639a7d47b74d4165a5 Mon Sep 17 00:00:00 2001 From: Donald Booth Date: Wed, 18 Mar 2020 13:30:01 -0500 Subject: [PATCH 1/2] Clarified formatting of templates. --- .../templates/template-email-migration.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/guides/v2.3/frontend-dev-guide/templates/template-email-migration.md b/src/guides/v2.3/frontend-dev-guide/templates/template-email-migration.md index 717d6a77f9a..db3a218c65b 100644 --- a/src/guides/v2.3/frontend-dev-guide/templates/template-email-migration.md +++ b/src/guides/v2.3/frontend-dev-guide/templates/template-email-migration.md @@ -22,6 +22,11 @@ Notice in the incorrect example, the `getConfirmationLink()` method is called di - Old way: `{{var subscriber.getConfirmationLink()}}` - New way: `{{var subscriber_data.confirmation_link}}` +Note that spaces should be not be used next to the braces: + +- Correct: `{{var subscriber_data.confirmation_link}}` +- Incorrect: `{{ var subscriber_data.confirmation_link }}` + We refer to this as 'strict mode' for email templates. All default templates have been converted to this strict mode. @@ -34,13 +39,13 @@ Any new email template created after installing 2.3.4 must be written in strict Pre-2.3.4, the New Order email template had a line with a direct method call: ```html -

{{trans "%customer_name," customer_name=$order.getCustomerName()}}

+

{{trans "%customer_name", customer_name=$order.getCustomerName()}}

``` As of 2.3.4, with the method call removed: ```html -

{{trans "%customer_name," customer_name=$order_data.customer_name}}

+

{{trans "%customer_name", customer_name=$order_data.customer_name}}

``` Below, within the `$transport` block, `customer_name` is defined in the `order_data` object and the method call place there. From 1d3c1004b966bccda5c8a0d29b42a0444c27238f Mon Sep 17 00:00:00 2001 From: Donald Booth Date: Wed, 18 Mar 2020 14:07:32 -0500 Subject: [PATCH 2/2] Linty --- .../frontend-dev-guide/templates/template-email-migration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/guides/v2.3/frontend-dev-guide/templates/template-email-migration.md b/src/guides/v2.3/frontend-dev-guide/templates/template-email-migration.md index db3a218c65b..e27f937fc5d 100644 --- a/src/guides/v2.3/frontend-dev-guide/templates/template-email-migration.md +++ b/src/guides/v2.3/frontend-dev-guide/templates/template-email-migration.md @@ -24,8 +24,8 @@ Notice in the incorrect example, the `getConfirmationLink()` method is called di Note that spaces should be not be used next to the braces: -- Correct: `{{var subscriber_data.confirmation_link}}` -- Incorrect: `{{ var subscriber_data.confirmation_link }}` +- Correct: `{{var subscriber_data.confirmation_link}}` +- Incorrect: `{{ var subscriber_data.confirmation_link }}` We refer to this as 'strict mode' for email templates. All default templates have been converted to this strict mode.