extract_plain_text_fallback — Extract Plain-Text MIME Fallback

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

Why buy vs. 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.

Pricing: $0.001 USD per HTML-to-plain-text MIME fallback conversion (x402 instant micropayment) · REST: POST https://mail-preflight.apikeg.com/v1/extract-plain-text-fallback · MCP: https://mail-preflight.apikeg.com/mcp

Input Parameters

FieldTypeRequired / DefaultDescription & Constraints
html string Required HTML email body to convert into a formatted text/plain MIME fallback with inline CTA URLs and stripped preheader padding. (minLength: 1, maxLength: 900000)
wrapWidth integer Default: 78 Soft line-wrap width in characters (default 78 per RFC 5322; URLs are never split). (min: 40, max: 120)

REST Example (curl)

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
}'

MCP tools/call Payload

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "extract_plain_text_fallback",
    "arguments": {
      "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
    }
  }
}