Issue:
- MailChimp campaigns missing body content in markdown files
- Logic flaw in HTML-to-markdown conversion flow
- Double cleaning and incorrect empty content checks
Root Cause:
- Checked already-cleaned content instead of original for HTML fallback
- HTML content never converted when plain_text was empty
- Applied cleaning twice when HTML was converted
Fix:
- Check original plain_text before deciding HTML conversion
- Convert HTML first, then clean once (eliminate double cleaning)
- Preserve all legitimate newsletter body content
- Keep header/footer cleaning patterns (they are appropriate)
Impact:
- All newsletter content now preserved correctly
- Headers/footers still properly removed
- Next production run will capture complete content
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>