Shipping notification email: tell customers it is on the way
Updated
A shipping notification replaces the "where is my order?" support ticket. Its job is to give a tracking link and a believable date.
When it fires
On the carrier or fulfilment event, usually "label scanned" or "shipment created", not when staff click "mark as shipped" in your admin and not when the label is merely printed.
Workflow
- Your fulfilment system posts a
shipment.createdevent with carrier and tracking number. - You build the tracking URL for that carrier.
- You send the email once per shipment (an order can have several).
- You store
shipment.notified_at.
Implementation (Python 3)
import os
import requests
TRACKING_URLS = {
"ups": "https://www.ups.com/track?tracknum={n}",
"usps": "https://tools.usps.com/go/TrackConfirmAction?tLabels={n}",
}
def notify_shipped(shipment, order):
if shipment.notified_at:
return
url = TRACKING_URLS[shipment.carrier].format(n=shipment.tracking_number)
resp = requests.post(
"https://api.inboxili.com/api/v1/transactional/send",
headers={"Authorization": f"Bearer {os.environ['INBOXILI_API_KEY']}"},
json={
"to": order.email,
"from_email": "orders@yourdomain.com",
"from_name": "Acme Store",
"subject": "Your order {{order_number}} has shipped",
"html_body": '<p>Order {{order_number}} is on its way with {{carrier}}. Estimated delivery: {{eta}}.</p><p><a href="{{url}}">Track your package</a></p>',
"text_body": f"Track your package: {url}",
"template_data": {
"order_number": order.number,
"carrier": shipment.carrier.upper(),
"eta": shipment.eta_display,
"url": url,
},
},
timeout=10,
)
resp.raise_for_status()
shipment.mark_notified(resp.json()["message_id"])
Sample email
Subject: Your order 10482 has shipped Order 10482 is on its way with UPS. Estimated delivery: Oct 12. Track your package
Things that go wrong
- Wrong carrier URL pattern. Test each carrier's link format with a real tracking number.
- Optimistic dates. If you cannot estimate reliably, say "within 3 to 5 business days" rather than a specific day.
- Multiple shipments per order producing confusing duplicates. Say "1 of 2 packages" in the body.
Delivery events
delivered and bounced webhooks let you show email status in your admin order view, which cuts support time when a customer says they never got it.
Deliverability notes
Tracking links should point at the carrier or your own domain. Third-party redirect domains in transactional mail look suspicious.
Frequently asked questions
- How many shipping emails should I send?
- At minimum one when the parcel ships. Add delivered and exception emails if your carrier integration provides reliable events. More than that without new information trains people to ignore you.
Send a shipping notification
Create a workspace, verify a domain, and make your first API call.