Body
mail_intake.parsers.body
Summary
Message body extraction utilities for Mail Intake.
This module contains helper functions for extracting a best-effort plain-text body from provider-native message payloads.
The logic is intentionally tolerant of malformed or partial data and prefers human-readable text over fidelity to original formatting.
Classes
Functions
extract_body
Extract the best-effort message body from a Gmail payload.
Priority:
text/plaintext/html(stripped to text)- Single-part body
- Empty string (if nothing usable found)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
payload |
Dict[str, Any]
|
Provider-native message payload dictionary. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Extracted plain-text message body. |