By default, Magento 2 shipment emails do not include any order tracking information. However, you can complement templates with an order tracking link and make boring confirmation emails more informative and customer-friendly. With Magento 2 Order Status Pro extension, you can easily add a Magento 2 Track Order link or a button to shipment emails that takes customers to a one-stop, personalized order tracking page.
Step 1. Add a Variable to the Shipment Email Template
In Magento 2 admin panel, go to Marketing -> Communications -> Email Templates, and then click Add New Template, or click on the existing template that is used for Stores -> Configuration -> Sales Emails -> Shipment -> Shipment Email Template (Default Config) or Stores -> Configuration -> Sales Emails -> Shipment -> Shipment Email Template for Guest (Default Config).
Step-by-step guide:
- In the Template Content field, click where you want to add the Track Order link.
- Click Insert Variable.
Step-by-step guide:
- Under Plumrocket / Shipping Tracking, find and insert the Shipping Tracking Url.
Step-by-step guide:
- This is the embedded Shipping Tracking URL variable that will add the order tracking link to your shipment emails.
- Click Save Template to save the changes.
Step 2. Style the Tracking Link
Additionally, you can add styles and customize the appearance of the Order Tracking link. In the example below, you can find the variable wrapped in HTML so that it looks like a button in shipment emails, which is more convenient and visible to customers.
<div style="text-align: center">
<a style="font-family: Arial, sans-serif; font-weight: bold; width: 220px; max-width: 100%; text-decoration: none; line-height: 1; font-size: 18px; background: #e14250; color: #ffffff; padding: 15px 10px; border-radius: 5px; display: inline-block; text-align: center; border: 1px solid #E45A66;"
rel="noopener noreferrer"
target="_blank"
href="{{var pr_shipping_tracking_url}}">
Track My Order
</a>
</div>
Step 3. Test the Magento 2 Track Order Link
In order to check what the link looks like, you need to create a test order and shipment, add a shipping tracking number and send a confirmation email.
Step-by-step guide:
- Here’s what the Magento 2 Track Order button looks like in shipment emails.
The Magento 2 Track My Order link/button takes users to an all-in-one order tracking page, provided by the Order Status & Shipping Tracking Pro extension. The page lists the order number, status, and all shipping details, including a carrier tracking number and package location details. Additionally, the page provides a visual list of purchased products.