Gorgias logo
Gorgias logo

All articles

Magento 2 VariablesUpdated 2 months ago

You can auto-populate Magento 2 data within a Macro by adding variables to it so you don't have to search for customer or order data and copy it manually into your message.



Variables

Customer name{{ticket.customer.integrations.magento2.customer.firstname}}
{{ticket.customer.integrations.magento2.customer.lastname}}

Customer email{{ticket.customer.integrations.magento2.customer.email}}
Customer date of birth{{ticket.customer.integrations.magento2.customer.dob|datetime_format("MMMM d YYYY")}}
Phone number used in last order{{ticket.customer.integrations.magento2.orders[0].extension_attributes.shipping_assignments[0].shipping.address.telephone}}
Store name{{ticket.customer.integrations.magento2.orders[0].store_name}}
Price of last order{{ticket.customer.integrations.magento2.orders[0].grand_total}}
{{ticket.customer.integrations.magento2.orders[0].order_currency_code}}
Products in last order{{ticket.customer.integrations.magento2.orders[0].items[0].name}}
{{ticket.customer.integrations.magento2.orders[0].items[1].name}}
{{ticket.customer.integrations.magento2.orders[0].items[2].name}}
...
Price of every item in last order{{ticket.customer.integrations.magento2.orders[0].items[0].base_price_incl_tax}}{{ticket.customer.integrations.magento2.orders[0].items[1].base_price_incl_tax}}{{ticket.customer.integrations.magento2.orders[0].items[2].base_price_incl_tax}}
...
SKU of every item in last order{{ticket.customer.integrations.magento2.orders[0].items[0].sku}}
{{ticket.customer.integrations.magento2.orders[0].items[1].sku}}
{{ticket.customer.integrations.magento2.orders[0].items[2].sku}}
...
Name of shipping company for last shipped order{{ticket.customer.integrations.magento2.shipments[0].tracks[0].title}}


Steps

1. Go to Settings -> Productivity -> Macros

2. Click on Create macro in the top right. 

3. Write your text and choose a variable from the dropdown menu at the bottom of the reply box, labeled Magento 2.

If you need to pre-populate data that's not one of our default variables, you can manually add yours as shown in our video at the top of the page.
Was this article helpful?
Yes
No