Documentation
Feedback
Guides
API Reference

Guides
Message Center
Including order variables in the transactional email template

Learn how to use variables and create custom Message Center templates.

In the Message Center, under the Templates tab, you will find the transactional email templates sent to your clients.

Some of them are fired when the status of an order changes. For example:

  • Order Confirmation: email sent when the order was made successfully.
  • Billed Order: email sent when the order is billed.
  • Delivery canceled: email sent when the order is canceled.

You can customize all of the Message Center templates, and you have a series of variables at your disposal that allow you to add data to the email dynamically.

These variables are JSON properties in the JSON Data field and can be used in the email's HTML. Insert them into double keys using the following format: {{variable}}

Example

Examples of JSON Data will only appear in the templates when you develop the desired action in your store. If you have not transacted an order, a recurrence, or any other action, JSON Data will be blank.

Let's say you want to enter the carrier's name in the "product sent" email.

To do this, enter the "product sent" template and search for the' courier' property in the JSON Data field.

{"base64":"  ","img":{"width":1204,"height":656,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":106965,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/including-order-variables-in-the-transactional-email-template-0.png"}}
The filled-in value for this property is just an example, but you can use it in the HTML field so that when the email is sent, the customer sees the carrier that is actually responsible for the order delivery.

Note that the courier property is inside the package object. Therefore, you need to enter it as follows:

{{package.courier}}

{"base64":"  ","img":{"width":1202,"height":989,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":174816,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/including-order-variables-in-the-transactional-email-template-1.png"}}

As you see, the sample value ("Transportadora Teste Courier S.A.") was inserted in the preview screen, below the HTML and JSON Data fields.

Other order email variables

Among the properties of order JSONs that can be used as variables in transactional email templates are:


_24
{
_24
"data": {
_24
"h-0": "Properties",
_24
"h-1": "Definition",
_24
"0-0": "`courier`",
_24
"0-1": "Courier",
_24
"1-0": "`invoiceNumber`",
_24
"1-1": "Invoice number",
_24
"2-0": "`invoiceValue`",
_24
"2-1": "Invoice value",
_24
"3-0": "`invoiceUrl`",
_24
"3-1": "Invoice URL",
_24
"4-0": "`issuanceDate`",
_24
"4-1": "Date of issue",
_24
"5-0": "`trackingNumber`",
_24
"5-1": "Order tracking number",
_24
"6-0": "`invoiceKey`",
_24
"6-1": "Invoice access key",
_24
"7-0": "`trackingUrl`",
_24
"7-1": "Order tracking URL (informed by the carrier)"
_24
},
_24
"cols": 2,
_24
"rows": 8
_24
}

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page