# Email to postal mail with mailbox.bot

Turn an email thread and its attachments into a reviewed physical mailing, then write delivery status back to the original workflow.

Human guide: https://mailbox.bot/workflows/email-to-postal-mail
Markdown guide: https://mailbox.bot/email-to-postal-mail.md
API reference: https://mailbox.bot/api-docs
Webhook guide: https://mailbox.bot/docs/webhooks

## When to use this workflow

An email may start a permit response, agreement packet, insurance request, inspection follow-up, or formal notice. If the next step calls for paper, preserve the thread's source identifiers and prepare the postal packet from approved documents.

## Sequence

1. Read the relevant email text, attachments, recipient, due date, and case or thread ID in your own application.
2. Decide whether physical mail is appropriate. Check the recipient, mailing class, document version, and whether a person must review the packet.
3. Create a mailbox.bot draft with `dry_run=true` to preview address validation and cost without dispatching it.
4. Ask a person to approve a live send when the mail is certified, time sensitive, or consequential. Use `requires_approval=true` where the API workflow calls for it.
5. Submit the approved mailing through mailbox.bot. Keep the email thread ID and source document ID in the mail job's `metadata`.
6. Consume mailbox.bot webhook events and update the original thread or case with the mailing state and proof.

The mailbox.bot webhook lifecycle can include `mail.pending_approval`, `mail.submitted`, `mail.mailed`, `mail.delivered`, and `mail.failed`. Delivery timing and proof depend on the mail class and carrier events.

## Example metadata

```json
{
  "source": "email_workflow",
  "workflow": "permit_response",
  "email_thread_id": "thread-123",
  "document_id": "permit-packet-v2",
  "case_number": "CASE-1042"
}
```

Use identifiers from your own email system. mailbox.bot handles the physical action and returns its status to your application; it does not need to own the email inbox.
