# `extract_plain_text_fallback` — Extract Plain-Text MIME Fallback

> Part of [MailPreflight Email QA & Deliverability API](https://mail-preflight.apikeg.com/llms.txt) (`com.apikeg/mail-preflight`)

Converts an HTML email into a clean, RFC 5322-wrapped text/plain MIME companion, preserving CTA links inline as 'Label (https://...)' and stripping invisible &#847; / &zwnj; preheader padding hacks.

**Why call instead of DIY:** Strips email-specific &zwnj;/&#847; preheader spacers and formats multi-column/CTA HTML cleanly in <5ms for $0.001 instead of naive strip-tags regexes.

- **REST Endpoint:** `POST https://mail-preflight.apikeg.com/v1/extract-plain-text-fallback`
- **MCP Server:** `https://mail-preflight.apikeg.com/mcp` (tool: `extract_plain_text_fallback`)
- **Pricing:** $0.001 USD per HTML-to-plain-text MIME fallback conversion (x402 instant micropayment)
- **Free Dry-Run:** `POST https://mail-preflight.apikeg.com/v1/extract-plain-text-fallback?dry_run=true`

## Input JSON Schema
```json
{
  "type": "object",
  "properties": {
    "html": {
      "type": "string",
      "minLength": 1,
      "maxLength": 900000,
      "description": "HTML email body to convert into a formatted text/plain MIME fallback with inline CTA URLs and stripped preheader padding."
    },
    "wrapWidth": {
      "type": "integer",
      "minimum": 40,
      "maximum": 120,
      "default": 78,
      "description": "Soft line-wrap width in characters (default 78 per RFC 5322; URLs are never split)."
    }
  },
  "required": [
    "html"
  ],
  "additionalProperties": false
}
```

## Examples
### Transactional receipt HTML to text/plain
```bash
curl -X POST "https://mail-preflight.apikeg.com/v1/extract-plain-text-fallback" \
  -H "Content-Type: application/json" \
  -d '{"html":"<div>Preview text &zwnj;&nbsp;&#847;&zwnj;&nbsp;&#847;</div><h1>Payment Received</h1><p>View your invoice: <a href=\"https://acme.com/inv/42\">Download PDF</a></p>","wrapWidth":78}'
```
Expected output: Returns clean wrapped text with 'Download PDF (https://acme.com/inv/42)' and zero invisible spacer characters.
