Skip to content

feat(send): messages send --html sends HTML with a plain-text alternative - #133

Open
leemour wants to merge 1 commit into
mainfrom
feat/send-html
Open

leemour wants to merge 1 commit into
mainfrom
feat/send-html

Conversation

@leemour

@leemour leemour commented Nov 8, 2026

Copy link
Copy Markdown
Member

What

  • mail <profile> messages send --html reads the text (argument or stdin) as HTML.
  • The plain-text part is made from the HTML with cli-core's htmlToText. The mail goes as multipart/alternative, and as multipart/mixed around that when files are attached.
  • Draft gains an optional html field, and build passes it to nodemailer. The answer adds html_chars.
  • --html together with --reply-to is refused (validation_error). A reply quotes its original as plain text, so an HTML part would not have the quote.

Why

This is the mail-cli step of the digest format plan (max-cli/docs_ai/plans/2026-11-07-digest-format.md, section 7 step 3). Today the email route sends the morning digest as raw Markdown, because messages send can only send plain text. With this flag, the cli-core renderer (and memo --deliver-to) can send HTML.

Not in this PR

  • --text-file <file> for a hand-written plain part. The plan mentions it as an option. It is not needed until a renderer makes its own plain text.
  • HTML for replies, forwards and drafts.

How tested

  • New test in src/send.test.ts: sends synthetic HTML through the fake SMTP server and checks multipart/alternative, the decoded plain part and the HTML part. It also checks that --html with --reply-to is refused and nothing is sent.
  • pnpm vitest run --maxWorkers=1: 26 files, 335 tests pass.
  • pnpm typecheck, pnpm lint (no new warnings), pnpm docs:check, pnpm contracts:check and pnpm test:matrix:check all pass.
  • docs/commands.md and docs/dev/test-matrix.md were regenerated.
  • Not tested: a real send through Gmail or another real SMTP server, and how the mail looks in a real mail client.

🤖 Generated with Claude Code

…tive

With --html the text (argument or stdin) is HTML. The plain-text part is
made from it with cli-core's htmlToText, and nodemailer builds a
multipart/alternative message. Draft gains an optional html field that
build passes through. The answer reports html_chars.

A reply with --html is refused: a reply quotes its original as plain
text, and an HTML part without that quote would differ from the plain
part.

This is the mail-cli step of the digest format plan, so the email route
can deliver an HTML digest instead of raw Markdown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant