Auto-reply to "where's my order?" emails with live tracking

When a customer emails a tracking number to your support inbox, we look it up in AfterShip and reply with the live status, location, and expected delivery.

Agentic Task
GmailAfterShipCustomer SupportOperationsEmail AutomationNotifications & Alerts
PromptCreate

Poll a dedicated Gmail label (for example 'shipping/support' or 'tracking-questions') for new incoming emails so this only fires on customer shipping questions, never on the rest of the inbox. For each new email that lands in that label, do the following as an agent.

Step 1. Call Gmail Get a Message with the incoming message id and format=full. Pull out the sender's name and email, the subject, the thread id, and the plain-text body.

Step 2. Read the body and extract the tracking number. It may be labelled ('Tracking:', 'order tracking number is...'), embedded in a URL, or bare. Also note any carrier name the customer mentions (UPS, FedEx, USPS, DHL, Royal Mail, etc.) — that hint helps resolve ambiguity later. If no tracking number is present in the email, skip straight to the fallback reply in step 6.

Step 3. Call AfterShip Detect Courier with the extracted tracking number. If it returns exactly one courier, use that slug. If it returns more than one and the customer named a carrier in their email, pick the courier whose name matches. If it returns nothing, or more than one with no hint from the customer, skip to the fallback reply in step 6.

Step 4. Try AfterShip Get Tracking by ID first in case we've already registered this tracking (search AfterShip for the tracking number if you need the id). If we don't have it yet, call AfterShip Create Tracking with the tracking number plus the detected courier slug so AfterShip starts tracking the shipment. Read the checkpoints array, the current tag/status, and the expected_delivery field from the response.

Step 5. Draft a plain-language reply that names where the package is right now (the city, state, or country from the latest checkpoint), the current status in customer-facing language (in transit, out for delivery, delivered, held at customs, delivery exception, etc.), and the expected delivery window. Keep it warm and short. No jargon, no raw status codes, no internal ids.

Step 6. Send the reply with Gmail Reply to a Message on the same thread id so the conversation stays intact. If the tracking number was missing, reply asking the customer to send it. If the courier was ambiguous, reply asking the customer to confirm which carrier they shipped with (UPS, FedEx, USPS, DHL, etc.). If Get Tracking or Create Tracking fails for any other reason, reply acknowledging the email and letting the customer know a teammate will follow up shortly.

The workflow should be safe to run automatically end-to-end — no human touches the thread unless a fallback branch triggers a follow-up ask.

Additional information

What does this prompt do?
  • Watches a dedicated Gmail label for inbound customer shipping questions so it never touches unrelated email
  • Reads each message, pulls the tracking number out of the body, and figures out which carrier it belongs to
  • Fetches the latest checkpoint and predicted delivery window from AfterShip
  • Sends a warm, plain-English reply on the same thread naming where the package is, its current status, and when it's expected
  • If the tracking number is missing or the carrier is ambiguous, asks the customer for the missing detail instead of guessing
What do I need to use this?
  • A Gmail account and a dedicated label (for example 'shipping/support' or 'tracking-questions') that inbound customer shipping questions route to
  • An AfterShip account that covers the couriers you ship with
How can I customize it?
  • Change which Gmail label the workflow watches so it lines up with your existing support routing
  • Tune the tone, greeting, and signature of the reply to match your brand voice
  • Adjust the fallback message that goes out when the tracking number is missing or the carrier can't be identified

FAQs

What if the customer forgets to include a tracking number?
The workflow spots the missing number and sends a friendly reply asking the customer to share it, so nothing falls through the cracks.
Do I really need a dedicated Gmail label?
Yes — that's how the workflow knows which emails to touch. Route inbound 'where's my order?' emails to a label like 'shipping/support' or 'tracking-questions' using Gmail's filters, and the workflow only fires on messages that land there.
What happens when the carrier can't be figured out from the tracking number?
If AfterShip returns more than one possible carrier and the customer's email doesn't hint at which one, the reply asks the customer to confirm the carrier (UPS, FedEx, USPS, DHL, and so on) instead of guessing.
Will the reply stay in the same email thread?
Yes. Replies go out threaded, so the customer sees a continuous conversation and your team's existing filters and views still work.
Which shipping carriers does this support?
AfterShip covers more than a thousand couriers worldwide, so any tracking number your customers send in should resolve as long as that carrier is enabled on your AfterShip account.

Related templates

Chase unsigned contracts and nudge stalled signers daily

Every weekday we find the contracts still waiting on a signature, resend the ones going stale, and post a prioritized chase list to Slack.

Documenso
Gmail
Slack Bot
Agentic Task
Filter spam from Netlify forms before it reaches your CRM

Every new form submission gets judged real or junk, sorted by intent, and only genuine sales leads land in HubSpot with an email brief waiting for your team.

Netlify
HubSpot
Gmail
Agentic Task
Log Netlify form submissions to Sheets and email the team

Every contact and demo request from your Netlify site lands as a row in your tracking spreadsheet and as an email to your shared team inbox.

Netlify
Google Sheets
Gmail
Deterministic Code
Weekly Netlify build health report across every site

Every Monday, get one email that reads build health across all of your Netlify sites, flags which ones got flakier, and logs a running history.

Netlify
Gmail
Google Sheets
Agentic Task
Catch contract auto-renewals before the notice deadline

Every month we read your signed contracts, find the ones about to auto-renew, and warn you before your window to renegotiate closes.

Documenso
Google Calendar
Gmail
+1
Agentic Task
Daily NetSuite collections digest in Slack with email drafts

Every weekday at 8am, see your total overdue balance ranked by account in Slack, with polite reminder emails waiting as drafts in Gmail.

NetSuite
Slack Bot
Gmail
Agentic Task

Stop typing "let me check on that" to every shipping question.

Turn inbound customer tracking questions into instant, on-brand replies with the live delivery status baked in.