Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit eb13311

Browse files
authored
Merge pull request #6887 from magento/dobooth-patch-1
Clarified formatting of email templates
2 parents a44e6e1 + 9ca9978 commit eb13311

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/guides/v2.3/frontend-dev-guide/templates/template-email-migration.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Notice in the incorrect example, the `getConfirmationLink()` method is called di
2222
- Old way: `{{var subscriber.getConfirmationLink()}}`
2323
- New way: `{{var subscriber_data.confirmation_link}}`
2424

25+
Note that spaces should be not be used next to the braces:
26+
27+
- Correct: `{{var subscriber_data.confirmation_link}}`
28+
- Incorrect: `{{ var subscriber_data.confirmation_link }}`
29+
2530
We refer to this as 'strict mode' for email templates.
2631
All default templates have been converted to this strict mode.
2732

@@ -34,13 +39,13 @@ Any new email template created after installing 2.3.4 must be written in strict
3439
Pre-2.3.4, the New Order email template had a line with a direct method call:
3540

3641
```html
37-
<p class="greeting">{{trans "%customer_name," customer_name=$order.getCustomerName()}}</p>
42+
<p class="greeting">{{trans "%customer_name", customer_name=$order.getCustomerName()}}</p>
3843
```
3944

4045
As of 2.3.4, with the method call removed:
4146

4247
```html
43-
<p class="greeting">{{trans "%customer_name," customer_name=$order_data.customer_name}}</p>
48+
<p class="greeting">{{trans "%customer_name", customer_name=$order_data.customer_name}}</p>
4449
```
4550

4651
Below, within the `$transport` block, `customer_name` is defined in the `order_data` object and the method call place there.

0 commit comments

Comments
 (0)