Articles on: Integrations

Connect Emarsys With AfterShip Tracking

Plans: All plans Platforms: All platforms


Emarsys is a customer engagement platform that allows you to unify sales, transactional, customer, and product data to deliver personalized cross-channel campaigns.

Emarsys’ integration with AfterShip Tracking consolidates all email & SMS communications into one centralized portal. Brands can create and send unified tracking notifications to customers as soon as the tracking status for orders get updated on AfterShip Tracking based on 7 key triggers ensuring engagement, consistency, and efficiency.

Additionally, you can improve customer retention and experience in the events of shipment exceptions by offering loyalty points applicable to future purchases.

What you’ll learn

In this article, we will show you:

Create API user in Emarsys admin
Set up Emarsys integration in AfterShip Tracking
AfterShip events synced to Emarsys
Merge tags (placeholder) available in Emarsys
Configure emails in Emarsys

Create API user in Emarsys admin

Log in to your Emarsys admin
Go to Management > Security Settings
Move to API users on the side panel
Click Create API user to create a new API user. Confirm your identity by entering your account password. Copy the API user Name and Secret and save it somewhere for later use and click OK

Click the pencil icon for the newly created API user and give necessary permissions for Customer and External event API scopes. Just shift the toggle to the right to allow Emarsys access to certain data within AfterShip Tracking. Click Edit (end of the page) to save the changes

Set up Emarsys integration in AfterShip Tracking

Go to Apps in the AfterShip Tracking admin
Click View more apps in the upper right-hand corner
Search Emarsys for AfterShip Tracking. Click on it and you will land on the Emarsys integration page
Navigate to the Emarsys integration page on AfterShip website directly

Click Install app
Select the right organization (online store) if you have multiple organizations configured in AfterShip Tracking (Optional) for which you are establishing this integration
On the Auth confirmation page, input your API User Name and Secret that you’ve created in the Emarsys Admin, then click Install app

You can check the connection under Apps dashboard of your AfterShip Tracking account

If you are using Emarsys-enabled tracking notifications, please turn off AfterShip Tracking notifications to avoid sending double notifications.

AfterShip Tracking shipment events synced to Emarsys

7 standard AfterShip Tracking events are synced to Emarsys, which act as triggers to replicate and send key shipment notifications in Emarsys to customers to keep them in the loop about the whereabouts of their packages.

In transit (External Event Name: aftership_shipment_in_transit)
Out for delivery (External Event Name: aftership_shipment_out_for_delivery)
Failed Attempt (External Event Name: aftership_shipment_failed_attempt)
Delivered (External Event Name: aftership_shipment_delivered)
Available for Pickup (External Event Name: aftership_shipment_available_for_pickup)
Exception (External Event Name: aftership_shipment_exception)
Info Received (External Event Name: aftership_shipment_info_received)

Merge tags (placeholder) available in Emarsys

Merge tags are used in an email template to auto-populate required customer and order information from our database according to the return request. Each Emarsys’ triggered email contains a list of available merge tags that can be embedded in the required place within the email subject, title, and body to import unique customer information.

{{event.tracking_slug}}Courier slug“dhl”
{{event.tracking_number}}Tracking number“9333993434”
{{event.tracking_title}}By default, this field shows the tracking number, but you can customize it as per your requirement when importing the shipment. (e.g., the order number)“#343433”
{{event.tracking_note}}The note associated with the shipment when you import it to the AfterShip Tracking admin“Just a note”
{{event.tracking_latest_substatus}}Current tracking sub-status of the shipment“Delivered_002”
{{event.tracking_latest_status}}Current tracking status of the shipment“Delivered”
{{event.tracking_latest_substatus_message}}Standard description/message of the tracking sub-status“Picked up by customer”
{{event.tracking_url}}The URL for the buyer to track the package. It can be the Branded Tracking Page or AfterShip Public Tracking Page URL“”
{{event.tracking_edd}}The shipment’s original estimated delivery date. It could be provided by the carrier, AfterShip AI, or based on your custom settings“2020-01-02” “2020-01-02 00:00”
{{event.tracking_pickup_location}}Shipment pickup location for the package receiver“13th Street, New York, NY 10011, USA, United States"
{{event.customer_email_address}}The customer's email address to the delivery notification.“”
{{event.billing_address}}The billing address of the order“13th Street, New York, NY 10011, USA, United States"
{{event.shipment_delivery_address}}The destination address of the shipment“13th Street, New York, NY 10011, USA, United States"
{{event.latest_location}}The latest location of the shipment“New York, USA, United States"
{{event.latest_update_time}}The latest update time on the shipment from courier.“2020-01-02”, “2020-01-02 00:00”
{{event.signed_by}}The package receiver's information“Alex Li”
{{event.courier_service_type}}Displays shipment's courier service type“Next day delivery”
{{event.order_number}}The customer-faced number identifying a purchase or order placed by a customer.“#343433”
{{event.order_date}}The date when the order is placed“2020-01-02”, “2020-01-02 00:00”
{{event.customer_name}}The customer's name to the delivery notification.“Alex Li”
{{event.customer_first_name}}The customer's first name to the delivery notification.“Alex”
{{event.shipment_package_count}}The # of package under this shipment“2”
{{event.ship_date}}The ship date of the shipment“2020-01-02”, “2020-01-02 00:00”
{{event.pickup_date}}The pickup date of the shipment“2020-01-02”, “2020-01-02 00:00”
{{event.delivery_date}}The delivery date of the shipment“2020-01-02”, “2020-01-02 00:00”
{{event.transit_time}}The total time it took so far spent on this shipment.“2020-01-02”, “2020-01-02 00:00”

Configure triggered emails in Emarsys

Log in to your Emarsys admin
Go to Channels > Triggered emails
Click Create Mail Stream and select Create Custom HTML Email

Configure the General settings of the email, like title, language, and category
Edit the Mail stream settings (optional)
Select the AfterShip Tracking External event under the Trigger settings
Click Create External Event and use the AfterShip shipment status event selected as the External Event Name for better reference
Click Save to save the general email settings

Move to the Content creation tab and edit the customer-facing content of the email notification, including the subject line, sender name, receiver email address, and preheader
Click on Source code on the side panel and insert/write the HTML code of your email body
You can use the supported placeholders mentioned above in the code itself to auto-populate relevant information

On the Campaign check tab, view all the warning messages, and errors in the email and rectify them accordingly. Once resolved, move to the Scheduling tab to activate the email

Your Emarsys’ triggered email is now set up. Your customers will receive an email notification when the shipment status updates to the corresponding event in the AfterShip Tracking admin.

Repeat steps 1 to 10 for all the AfterShip shipment status events you want to trigger an email for.

Updated on: 18/04/2024

Was this article helpful?

Share your feedback


Thank you!