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

Clarified formatting of email templates #6887

Merged
merged 3 commits into from
Mar 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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
<p class="greeting">{{trans "%customer_name," customer_name=$order.getCustomerName()}}</p>
<p class="greeting">{{trans "%customer_name", customer_name=$order.getCustomerName()}}</p>
```

As of 2.3.4, with the method call removed:

```html
<p class="greeting">{{trans "%customer_name," customer_name=$order_data.customer_name}}</p>
<p class="greeting">{{trans "%customer_name", customer_name=$order_data.customer_name}}</p>
```

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