Marathon.Adapters.Mailgun
Mailgun adapter (specs/email.md §5), modeled on Swoosh.Adapters.Mailgun. build_request is PURE — it turns an Email + config into the exact HTTP request parts (URL, Basic-auth header, urlencoded body), so the whole Mailgun contract is unit-tested with no network. The IO send lives in deliver/2 (Phase C). Provider-specific but self-contained — part of the future mail library.
Functions
Turn an Email + config ({base, domain, key}) into Mailgun's HTTP request parts: { url, auth, body }. url is {base}/v3/{domain}/messages; auth is HTTP Basic for 'api:<key>'; body is the urlencoded message form (from/to/subject/text/html + optional cc/bcc/Reply-To). Pure — no network.
Send an Email via Mailgun's HTTP API over march's native HTTPS client (Marathon.HttpClient — no more curl shell-out, now that compiled TLS works). Returns Ok(response body incl. the message id) on a 2xx, else Err with Mailgun's message. Success is gated on the real HTTP status code, not on the body happening to contain \
Validate an Email is sendable BEFORE hitting Mailgun (review finding #6/#7): at least one recipient and at least one body (text or html). Ok(()) or Err(\