Automate shipment notifications, exception alerts, and carrier coordination while maintaining the accuracy and traceability your SLAs require.
Logistics operations run on time-critical communication between shippers, carriers, warehouses, customs brokers, and customers. A delayed exception notice or an inaccurate shipment update can trigger SLA penalties, missed deliveries, or regulatory violations. AI agents can absorb much of this coordination load — monitoring ETAs, detecting exceptions, drafting carrier escalations — but only if the email layer they operate through is accurate, auditable, and access-controlled. MultiMail gives logistics agents a structured email API purpose-built for operational environments where every message has downstream consequences.
A weather delay or carrier exception triggers a chain of notifications: customer SLA notice, internal ops alert, warehouse rescheduling, customs broker update. Manual handling introduces lag; AI agents can fire these in sequence, but only if the email infrastructure can confirm delivery and track which notifications went to which recipients.
Customs and trade communications must match filed records exactly. An agent that drafts a shipment status email with incorrect HS codes or declared values creates a compliance gap between what was filed and what was communicated. Traceability from message to filed document is non-negotiable.
Under 49 CFR hazmat regulations, communications involving dangerous goods must include required handling instructions, emergency contact information, and proper shipping names. An AI agent that omits this information — even in routine status updates — creates regulatory exposure.
Shipment data is shared across carriers, brokers, warehouses, and customers — each with different visibility rights. An agent routing a shipment update must send the right fields to the right recipient. Oversharing rate structures to a customer, or routing data to an unauthorized carrier, creates both commercial and compliance problems.
When a customer claims they were not notified of a delay, the question is not just whether an email was sent — it is what was in it, when it was delivered, and whether it reached the right contact. Operational traceability requires immutable send records tied to shipment events, not just delivery receipts.
Agents operating in monitored mode send shipment updates, ETA changes, and exception alerts without requiring human approval on every message. Your ops team receives a copy of outbound communications and can intervene if something looks wrong, without becoming a bottleneck on routine notifications.
When an agent needs to send a formal SLA breach notice, a hazmat incident report, or a carrier dispute escalation, gated_send mode holds the draft for human review before delivery. The agent composes the message and files supporting data; a logistics manager approves before it reaches the recipient.
Agents that monitor inbound carrier updates, customs status changes, and warehouse confirmations can operate in read_only mode — parsing and routing information internally without any risk of sending an unintended outbound message.
High-volume, templated communications — daily inventory reconciliation emails to warehouses, automated pickup confirmations to carriers, scheduled customs broker status requests — can run in autonomous mode once your team has verified the agent's accuracy on representative samples.
import httpx
client = httpx.Client(
base_url="https://api.multimail.dev",
headers={"Authorization": "Bearer $MULTIMAIL_API_KEY"}
)
def notify_shipment_exception(
tracking_number: str,
customer_email: str,
exception_type: str,
new_eta: str,
original_eta: str
) -> dict:
response = client.post("/v1/send_email", json={
"from": "[email protected]",
"to": customer_email,
"subject": f"Shipment Update: {tracking_number} — Delivery Rescheduled",
"body": (
f"Your shipment {tracking_number} has encountered a {exception_type} delay.\n\n"
f"Original ETA: {original_eta}\n"
f"Revised ETA: {new_eta}\n\n"
"Our team is monitoring this shipment and will notify you of any further changes. "
"Contact [email protected] if you need immediate assistance."
),
"metadata": {
"tracking_number": tracking_number,
"exception_type": exception_type,
"event": "delivery_exception"
}
})
response.raise_for_status()
return response.json()
result = notify_shipment_exception(
tracking_number="1Z9999999999999999",
customer_email="[email protected]",
exception_type="weather",
new_eta="2026-04-22",
original_eta="2026-04-20"
)
print(f"Notification sent: {result[&"cm">#039;message_id']}")Send a weather delay notice to a customer while preserving the shipment event reference for traceability. Uses the MultiMail REST API send_email endpoint.
import httpx
client = httpx.Client(
base_url="https://api.multimail.dev",
headers={"Authorization": "Bearer $MULTIMAIL_API_KEY"}
)
def draft_hazmat_incident_alert(
incident_id: str,
shipment_id: str,
un_number: str,
proper_shipping_name: str,
incident_description: str,
recipient_email: str
) -> dict:
"""Draft a hazmat incident notice. Held for approval before delivery."""
response = client.post("/v1/send_email", json={
"from": "[email protected]",
"to": recipient_email,
"subject": f"[HAZMAT INCIDENT] Shipment {shipment_id} — Immediate Attention Required",
"body": (
f"Incident Reference: {incident_id}\n"
f"Shipment: {shipment_id}\n"
f"Material: {proper_shipping_name} (UN {un_number})\n\n"
f"Incident Summary:\n{incident_description}\n\n"
"Emergency Contact: +1-800-555-0199 (24/7 hazmat response)\n"
"This message contains required hazardous materials handling information "
"per 49 CFR Part 172."
),
"oversight_mode": "gated_send",
"metadata": {
"incident_id": incident_id,
"shipment_id": shipment_id,
"un_number": un_number,
"event": "hazmat_incident"
}
})
response.raise_for_status()
data = response.json()
print(f"Draft pending approval — message_id: {data[&"cm">#039;message_id']}")
print(f"Approval required before delivery to {recipient_email}")
return data
draft_hazmat_incident_alert(
incident_id="INC-2026-0419-001",
shipment_id="SHP-7834921",
un_number="1263",
proper_shipping_name="Paint",
incident_description="Container integrity breach detected at Chicago distribution center. "
"Approximately 4 liters of material leaked onto pallet.",
recipient_email="[email protected]"
)For hazardous goods incidents, the agent drafts the alert and routes it for human approval before delivery. Uses gated_send mode so the message is held until an ops manager reviews it.
"cm"># MCP tool sequence executed by a logistics agent in Claude Desktop
"cm"># Tools: check_inbox, read_email, send_email
"cm"># Step 1: Poll carrier update mailbox
"cm"># MCP tool: check_inbox
"cm"># Arguments: { "mailbox": "[email protected]", "unread_only": true }
"cm"># Step 2: Read the carrier update
"cm"># MCP tool: read_email
"cm"># Arguments: { "message_id": "<returned from check_inbox>" }
# Step 3: Extract fields and route internally
# The agent parses the carrier message and sends only the
# customer-relevant fields — ETA, status, tracking URL —
# without forwarding carrier rate data or internal routing codes.
# MCP tool: send_email
# Arguments:
# {
# "from": "[email protected]",
# "to": "[email protected]",
# "subject": "Carrier Update: Inbound Shipment SHP-7834921",
# "body": "Carrier confirmed delivery window: 08:00–12:00 on 2026-04-21.\n"
# "Dock assignment required by 07:30. Tracking: 1Z9999999999999999.",
# "metadata": {
# "shipment_id": "SHP-7834921",
# "source": "carrier_update_ingest"
"cm"># }
"cm"># }
"cm"># Result: warehouse receives only what they need.
"cm"># Carrier rate data and internal routing codes stay off the message.
"cm"># Full send record preserved with metadata for SLA audit.Using MultiMail's MCP server, an agent connected to Claude Desktop or Cursor can read inbound carrier updates and route the relevant fields to internal stakeholders without exposing rate or routing data to unauthorized recipients.
import httpx
import time
from dataclasses import dataclass
client = httpx.Client(
base_url="https://api.multimail.dev",
headers={"Authorization": "Bearer $MULTIMAIL_API_KEY"}
)
@dataclass
class InventoryAlert:
sku: str
product_name: str
current_qty: int
reorder_point: int
supplier_email: str
lead_time_days: int
def dispatch_inventory_alerts(alerts: list[InventoryAlert]) -> list[str]:
message_ids = []
for alert in alerts:
shortfall = alert.reorder_point - alert.current_qty
response = client.post("/v1/send_email", json={
"from": "[email protected]",
"to": alert.supplier_email,
"subject": f"Reorder Request: {alert.sku} — {alert.product_name}",
"body": (
f"SKU: {alert.sku}\n"
f"Product: {alert.product_name}\n"
f"Current Stock: {alert.current_qty} units\n"
f"Reorder Point: {alert.reorder_point} units\n"
f"Requested Quantity: {shortfall + alert.reorder_point} units\n"
f"Required Lead Time: {alert.lead_time_days} days\n\n"
"Please confirm availability and earliest ship date."
),
"oversight_mode": "autonomous",
"metadata": {
"sku": alert.sku,
"event": "inventory_reorder",
"current_qty": alert.current_qty
}
})
response.raise_for_status()
message_ids.append(response.json()["message_id"])
time.sleep(0.1) "cm"># respect send rate
return message_ids
alerts = [
InventoryAlert("SKU-A4412", "Packing Foam 24x18", 120, 500, "[email protected]", 5),
InventoryAlert("SKU-B9901", "Stretch Wrap 80ga", 45, 200, "[email protected]", 3),
]
ids = dispatch_inventory_alerts(alerts)
print(f"Dispatched {len(ids)} reorder alerts: {ids}")When inventory levels drop below threshold across multiple SKUs, the agent sends supplier alerts in autonomous mode. Metadata tags each alert for downstream reconciliation.
| Regulation | Requirement | How MultiMail helps |
|---|---|---|
| 49 CFR Hazmat Regulations | Communications involving hazardous materials must include proper shipping names, UN identification numbers, emergency contact information, and required handling instructions. These cannot be omitted even in status updates. | Use gated_send mode for hazmat incident communications so a qualified ops manager reviews each message before delivery. Metadata fields on send_email allow you to attach UN numbers and shipping names for audit traceability, and the full message body is preserved in send records. |
| FMCSA Recordkeeping Requirements | Motor carriers must maintain records of communications related to Hours of Service violations, accidents, and driver qualification. Email communications that constitute notice or instruction in these areas must be traceable and retrievable. | Every MultiMail send and receive event is stored with a message_id, timestamp, sender, recipient, and metadata payload. Attaching event type and shipment identifiers via metadata gives you a queryable audit trail that maps communications back to specific FMCSA-relevant events. |
| Customs and Trade Compliance | Communications to customs brokers, freight forwarders, and government agencies must accurately reflect filed documentation. Discrepancies between email content and filed entry data can trigger audits or penalties under CBP and AES regulations. | Agents can attach filing reference numbers and declared values as metadata on outbound customs communications, creating a link between the email record and the filed document. Monitored mode ensures your trade compliance team can review the agent's outbound customs correspondence without approving each message individually. |
| Contractual SLA Obligations | Many logistics contracts specify maximum notification windows for delays, exceptions, and incidents. Failure to notify within the contracted window — even if the underlying event was handled — constitutes a breach. | Agents can fire exception notifications within seconds of detecting an event, with delivery timestamps preserved in send records. When a customer disputes whether notification was timely, the message_id and timestamp provide unambiguous evidence of when the email was sent and delivered. |
Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 50-tool MCP server. Formally verified in Lean 4.