Email Infrastructure for Food Delivery at Operational Speed

AI agents can handle order confirmations, delay notices, refund updates, and courier coordination without manual intervention — with full audit trails for every send.


Food delivery platforms and ghost kitchens operate on tight timing windows where a delayed or inaccurate email directly translates to refund requests, negative reviews, and churn. The communication surface is wide: diners expect real-time order status, couriers need pickup and route updates, and partner restaurants require accurate order details and settlement reports. High promotional send volumes add another layer — suppression lists, consent records, and local marketing regulations must be respected at scale. AI agents are well-suited to automate the routine high-volume flows, but the cost of a wrong order detail or a misfired refund notice is immediate and visible to the customer. MultiMail's monitored oversight mode lets agents send autonomously while operations teams retain visibility into every outbound message, making it practical to automate without losing accountability.

Email challenges in Food Delivery & Ghost Kitchens

Order accuracy under real-time fulfillment changes

Order details — items, estimated delivery time, pickup address — can change after confirmation as kitchen capacity, courier availability, or inventory shifts. Emails sent with stale data trigger refund requests and support tickets. Agents need to pull current state at send time, not cache it from the order creation event.

Timing-sensitive delivery updates

Delivery status emails (out for delivery, arriving in 10 minutes, delivered) have a narrow window of usefulness. Sent too early they create false expectations; sent after arrival they're noise. Agents must trigger sends from real fulfillment events, not scheduled jobs.

Refund and cancellation communication obligations

State consumer protection laws and platform terms require accurate, timely refund status notices. An agent that sends a 'refund processed' email before the payment processor confirms the reversal creates legal exposure and undermines customer trust.

Partner restaurant and courier coordination at volume

Ghost kitchens operating multiple virtual brands send high volumes of operational emails to restaurant partners and couriers daily. These must preserve traceability — who received what, when, and whether it was acted on — for dispute resolution and settlement reconciliation.

Promotional compliance across jurisdictions

Re-engagement campaigns and promotional sends must honor suppression lists, CAN-SPAM unsubscribe headers, CCPA opt-out records, and GDPR consent where EU customers are involved. A single suppression list failure on a large promotional send creates regulatory exposure and deliverability damage.

Allergen and dietary claims in customer communications

FDA Food Code and state food safety regulations create liability when customer emails contain inaccurate allergen or dietary information. Agents generating personalized menu recommendations or order summaries must not make claims the underlying data cannot support.


How MultiMail helps

Automated order and delivery notifications

Agents call send_email and reply_email to dispatch order confirmations, estimated arrival windows, and delivered confirmations triggered directly from fulfillment webhooks. In monitored mode, every send is visible to your operations team in real time without requiring their approval, so high-volume flows run at operational speed with full observability.

monitored

Refund and cancellation status notices

Agents poll payment processor state before sending refund confirmation emails, calling send_email only after the reversal is confirmed. Using gated_send mode for refund communications ensures a human reviews the notice before it reaches the customer, preventing premature confirmations that contradict payment processor state.

gated_send

Partner restaurant and courier operational updates

Agents send order details, pickup confirmations, and settlement summaries to restaurant partners and couriers via dedicated mailboxes. Monitored mode provides a full audit trail for every partner communication, supporting dispute resolution without requiring human approval on routine operational messages.

monitored

Customer feedback and re-engagement campaigns

Agents manage post-delivery feedback requests and re-engagement sends against verified suppression lists. Autonomous mode is appropriate here for bulk sends where consent records are current, opt-out handling is automated via the cancel_message endpoint, and suppression list checks run before each send.

autonomous

Escalated customer support threads

When a diner responds to a delivery update with a complaint or refund request, agents use check_inbox and get_thread to read the conversation and tag_email to classify it, then route to human agents via gated_all mode before any reply is sent. This prevents automated responses to sensitive dispute threads.

gated_all

Implementation

Order confirmation on fulfillment webhook
python
import multimail
from multimail import Multimail

client = Multimail(api_key="$MULTIMAIL_API_KEY")

def handle_order_confirmed(event: dict):
    order = event["order"]
    "cm"># Pull current order state — never use cached data from order creation
    items_summary = ", ".join(
        f"{item[&"cm">#039;quantity']}x {item['name']}" for item in order["items"]
    )
    allergen_note = order.get("allergen_flags", [])
    body = f"""Your order "cm">#{order['id']} is confirmed.

Items: {items_summary}
Estimated delivery: {order[&"cm">#039;eta_minutes']} minutes
Delivery address: {order[&"cm">#039;delivery_address']}
"""
    if allergen_note:
        body += f"\nAllergen info on file: {&"cm">#039;, '.join(allergen_note)}"

    client.send_email(
        from_address=f"orders@{order[&"cm">#039;brand_domain']}",
        to=order["customer_email"],
        subject=f"Order "cm">#{order['id']} confirmed — arriving in {order['eta_minutes']} min",
        body=body,
        metadata={"order_id": order["id"], "event": "order_confirmed"}
    )

Send an order confirmation email immediately after a fulfillment event, pulling live order state at send time rather than using cached data from order creation.

Delivery status update pipeline
python
import multimail
from multimail import Multimail
from enum import Enum

client = Multimail(api_key="$MULTIMAIL_API_KEY")

STATUS_SUBJECTS = {
    "out_for_delivery": "Your order is on the way",
    "arriving_soon": "Your order arrives in ~5 minutes",
    "delivered": "Your order has been delivered",
}

STATUS_BODIES = {
    "out_for_delivery": lambda o: f"Order "cm">#{o['id']} has been picked up by {o['courier_name']} and is heading your way.",
    "arriving_soon": lambda o: f"Order "cm">#{o['id']} is about 5 minutes away. Head to the door.",
    "delivered": lambda o: f"Order "cm">#{o['id']} was delivered at {o['delivered_at']}. Enjoy your meal.",
}

def handle_delivery_status(event: dict):
    order = event["order"]
    status = event["status"]
    if status not in STATUS_SUBJECTS:
        return  # Ignore internal statuses not surfaced to customers

    client.send_email(
        from_address=f"updates@{order[&"cm">#039;brand_domain']}",
        to=order["customer_email"],
        subject=STATUS_SUBJECTS[status],
        body=STATUS_BODIES[status](order),
        metadata={"order_id": order["id"], "delivery_status": status}
    )

Trigger delivery status emails from real fulfillment events using MultiMail's send_email endpoint. Each status transition fires a targeted update rather than a polling job.

Refund confirmation with payment processor guard
python
import multimail
from multimail import Multimail
import stripe

client = Multimail(api_key="$MULTIMAIL_API_KEY")
stripe.api_key = "sk_live_your_stripe_key"

def send_refund_confirmation(order_id: str, customer_email: str, refund_id: str):
    "cm"># Verify the refund is actually succeeded before sending
    refund = stripe.Refund.retrieve(refund_id)
    if refund.status != "succeeded":
        raise ValueError(
            f"Refund {refund_id} status is &"cm">#039;{refund.status}', not 'succeeded'. "
            "Deferring email until refund clears."
        )

    amount = refund.amount / 100  # cents to dollars
    currency = refund.currency.upper()

    # gated_send: human reviews before customer receives this
    client.send_email(
        from_address="[email protected]",
        to=customer_email,
        subject=f"Refund of {currency} {amount:.2f} processed for order "cm">#{order_id}",
        body=(
            f"Your refund of {currency} {amount:.2f} for order "cm">#{order_id} has been processed.\n\n"
            f"Refund ID: {refund_id}\n"
            "Funds typically appear within 3–5 business days depending on your bank."
        ),
        oversight_mode="gated_send",
        metadata={"order_id": order_id, "refund_id": refund_id}
    )

Use gated_send mode to hold refund confirmation emails until a human reviews them, preventing premature sends when payment processor reversal is pending.

Promotional send with suppression list enforcement
python
import multimail
from multimail import Multimail

client = Multimail(api_key="$MULTIMAIL_API_KEY")

def run_reengagement_campaign(recipients: list[dict], brand_slug: str):
    sent = 0
    skipped = 0

    for recipient in recipients:
        "cm"># Check inbox for prior unsubscribe or opt-out signal
        inbox = client.check_inbox(
            mailbox=f"unsubscribes@{brand_slug}.multimail.dev",
            query=recipient["email"],
            limit=1
        )
        if inbox.get("total", 0) > 0:
            skipped += 1
            continue  "cm"># Respect prior opt-out

        client.send_email(
            from_address=f"offers@{brand_slug}.multimail.dev",
            to=recipient["email"],
            subject="We miss you — here&"cm">#039;s 20% off your next order",
            body=(
                f"Hi {recipient[&"cm">#039;first_name']},\n\n"
                "It&"cm">#039;s been a while. Use code WELCOME20 for 20% off your next order.\n\n"
                "To stop receiving emails, reply with UNSUBSCRIBE."
            ),
            headers={
                "List-Unsubscribe": f"<mailto:unsubscribes@{brand_slug}.multimail.dev>",
                "List-Unsubscribe-Post": "List-Unsubscribe=One-Click"
            },
            metadata={"campaign": "reengagement_20pct", "recipient_id": recipient["id"]}
        )
        sent += 1

    return {"sent": sent, "skipped_suppressed": skipped}

Run re-engagement campaigns with automated suppression list checks and CAN-SPAM-compliant unsubscribe handling using the MultiMail API.

Inbound complaint triage with gated reply
python
import multimail
from multimail import Multimail

client = Multimail(api_key="$MULTIMAIL_API_KEY")

COMPLAINT_KEYWORDS = ["refund", "wrong order", "missing", "late", "cold", "cancel", "allerg"]

def triage_support_inbox(mailbox: str):
    inbox = client.check_inbox(mailbox=mailbox, limit=50, filter_tag="unread")

    for message in inbox.get("messages", []):
        body_lower = message["snippet"].lower()
        is_complaint = any(kw in body_lower for kw in COMPLAINT_KEYWORDS)

        if is_complaint:
            "cm"># Tag for ops team visibility
            client.tag_email(
                message_id=message["id"],
                tags=["complaint", "needs-human-review"]
            )
            "cm"># Pull full thread for context
            thread = client.get_thread(thread_id=message["thread_id"])

            "cm"># Draft a holding reply — gated_all requires human approval before send
            client.reply_email(
                message_id=message["id"],
                body=(
                    "Thank you for reaching out. A member of our support team "
                    "will review your order and follow up within 2 hours."
                ),
                oversight_mode="gated_all",
                metadata={"thread_id": message["thread_id"], "triage": "complaint"}
            )

Read inbound customer complaint threads and route them for human review before any automated reply is sent, using check_inbox, get_thread, tag_email, and gated_all mode.


Regulatory considerations

RegulationRequirementHow MultiMail helps
CAN-SPAMAll commercial email must include a functioning unsubscribe mechanism, a physical mailing address, and must honor opt-out requests within 10 business days. Re-engagement and promotional campaigns are subject to these requirements; transactional order emails have narrower exemptions.MultiMail supports List-Unsubscribe and List-Unsubscribe-Post headers on outbound sends. Suppression list checks can be enforced in agent code by querying a dedicated unsubscribe mailbox via check_inbox before each promotional send. The cancel_message endpoint allows in-flight sends to be cancelled when a new opt-out arrives during a campaign run.
CCPACalifornia residents have the right to opt out of the sale or sharing of personal data used for targeted communications. Re-engagement campaigns using purchase history or behavioral data for personalization must provide a clear opt-out path and honor prior opt-out signals.Agent workflows can query opt-out status before each send using check_inbox against a dedicated opt-out mailbox, and tag opt-out requests with tag_email for downstream processing. Metadata fields on each send preserve the consent basis used, supporting audit responses to consumer rights requests.
GDPRFor EU customers, marketing emails require a lawful basis (typically explicit consent). Consent records must be current and traceable. Data used to personalize communications must be limited to the purpose for which consent was given. Right to erasure requests must be actable.Monitored mode provides a full send log with timestamps, recipient identifiers, and metadata fields where consent basis can be recorded per message. This supports audit responses. Agent code can enforce consent checks before sending by reading stored consent state and short-circuiting the send_email call when consent is absent or expired.
FDA Food Code / State Food Safety LawsCustomer-facing communications containing allergen information, dietary claims, or health-related statements must be accurate. Inaccurate allergen disclosures in order confirmation emails can create direct liability under state consumer protection laws.MultiMail does not generate order content — agents must pull allergen and dietary data from authoritative menu databases at send time rather than caching it. The metadata field on each send_email call can record the data source and version used, creating an audit trail that links each email to the menu snapshot it was generated from.
State Consumer Protection LawsRefund, cancellation, and delay notices must be accurate and timely. Sending a refund confirmation before the payment processor confirms the reversal, or a cancellation notice with incorrect order details, can constitute a deceptive trade practice under state consumer protection statutes.Gated_send oversight mode holds refund and cancellation emails for human review before delivery, preventing premature sends. For automated flows, agents can verify payment processor state via API before calling send_email, and the monitored mode audit log provides a timestamped record of when each notice was sent relative to the fulfillment event.

Common questions

Can MultiMail handle the volume of order confirmation emails a large delivery platform sends?
Yes. MultiMail's send_email endpoint is designed for high-throughput agent workflows. Each call is synchronous and returns a message ID immediately; delivery happens asynchronously. For platforms sending tens of thousands of order confirmations per day, the recommended pattern is to trigger send_email directly from fulfillment webhook handlers rather than batching, so each email reflects current order state at the moment of send.
How does monitored mode work for delivery update emails?
In monitored mode, agents send emails autonomously without waiting for human approval. Your operations team receives notifications for each outbound message and can view the full send log via the MultiMail dashboard or by calling check_inbox on the sending mailbox. If an agent sends an incorrect update, a human can use cancel_message to cancel pending messages in the delivery queue before they reach the customer.
Can I use MultiMail for both transactional (order) and promotional (re-engagement) emails from the same account?
Yes. You can create separate mailboxes for transactional and promotional sends — for example, [email protected] and [email protected] — and apply different oversight modes to each. Promotional sends typically run in autonomous mode with suppression list checks enforced in agent code; transactional sends run in monitored mode for operational visibility.
How do I handle inbound replies from customers who respond to order confirmation emails?
MultiMail supports bidirectional email. Customers who reply to order confirmation emails have those replies delivered to the mailbox the send originated from. Your agent can poll that mailbox with check_inbox, read replies with read_email, classify them with tag_email, and use get_thread to retrieve full conversation context before deciding whether to reply automatically (monitored mode) or route to a human (gated_all mode).
What happens if I need to cancel an order confirmation email after it has been sent?
The cancel_message endpoint allows you to cancel messages that are in the delivery queue but not yet delivered. For already-delivered messages, you cannot unsend them — the correct action is to send a follow-up correction via send_email or reply_email. This is why pulling live order state at send time (rather than caching from order creation) is the recommended pattern for order confirmation workflows.
How does MultiMail help with partner restaurant and courier email traceability?
Every send_email call returns a message ID and accepts a metadata object where you can attach order IDs, courier IDs, or partner identifiers. These are queryable via check_inbox and read_email, and are included in webhook payloads for delivery status events. This lets you reconstruct exactly which partner received which operational update at what time, which is useful for dispute resolution and settlement reconciliation.
Does MultiMail support sending from custom domains like our restaurant brand domains?
Yes. You can create mailboxes on your own domains by configuring DNS records for the multimail.dev mail infrastructure. Ghost kitchens operating multiple virtual brands can create separate mailboxes per brand — for example, [email protected] and [email protected] — each with independent sending identities, suppression lists, and oversight mode configurations.

Explore more industries

The only agent email with a verifiable sender

Email infrastructure built for AI agents. Verifiable identity, graduated oversight, and a 50-tool MCP server. Formally verified in Lean 4.