"""Shared HTML -> plaintext conversion for outbound campaigns. Every campaign we build was HTML-only (no plaintext MIME part). A missing text/plain alternative is a spam-score signal: legitimate bulk senders ship multipart/alternative, and several filters (and most "this looks like spam" heuristics) penalise HTML-only mail. It also degrades the experience for plaintext-only clients and accessibility tooling. Listmonk only emits multipart/alternative when a campaign's `altbody` is set; otherwise it sends text/html alone. So we generate a readable plaintext rendition from the HTML body and pass it as `altbody`. This is intentionally dependency-free (no bs4/html2text on the prod box): a small, well-tested regex pipeline that: - drops