Summary
Please add a --body-html-file option to gog gmail send, analogous to the existing plain-text --body-file option.
Current behavior
gog gmail send currently supports:
--body-file=STRING Body file path (plain text; '-' for stdin)
--body-html=STRING Body (HTML; optional)
So when sending an HTML email from a prepared file, the practical workaround is something like:
gog gmail send \
--to recipient@example.com \
--subject "Subject" \
--body-file tmp/email.txt \
--body-html "$(cat tmp/email.html)"
This works for small HTML bodies, but it is awkward and can fail for larger HTML documents because the entire HTML body has to fit into the shell command argv/env limits. It also makes command previews noisy and harder to review.
Proposed behavior
Add:
--body-html-file=STRING HTML body file path; '-' for stdin if feasible
Example:
gog gmail send \
--to recipient@example.com \
--subject "Subject" \
--body-file tmp/email.txt \
--body-html-file tmp/email.html \
--json --no-input
Why this helps
- Avoids argv length limits for larger HTML emails.
- Matches the ergonomics of
--body-file for plain text.
- Makes scripted HTML email sending cleaner and easier to audit.
- Avoids shell-specific command substitution edge cases and huge command previews.
Implementation sketch
This should be a narrow CLI addition:
- Add a
bodyHTMLFile / body-html-file flag to the Gmail send command.
- Read the file content using the same file/stdin helper pattern as
--body-file, if one already exists.
- Reject using both
--body-html and --body-html-file together.
- Feed the loaded string into the same MIME/HTML body path currently used by
--body-html.
- Add a small CLI test covering HTML-from-file and the mutual-exclusion error.
@steipete if this UX is acceptable, say the word and I can prepare a PR.
Summary
Please add a
--body-html-fileoption togog gmail send, analogous to the existing plain-text--body-fileoption.Current behavior
gog gmail sendcurrently supports:So when sending an HTML email from a prepared file, the practical workaround is something like:
This works for small HTML bodies, but it is awkward and can fail for larger HTML documents because the entire HTML body has to fit into the shell command argv/env limits. It also makes command previews noisy and harder to review.
Proposed behavior
Add:
Example:
gog gmail send \ --to recipient@example.com \ --subject "Subject" \ --body-file tmp/email.txt \ --body-html-file tmp/email.html \ --json --no-inputWhy this helps
--body-filefor plain text.Implementation sketch
This should be a narrow CLI addition:
bodyHTMLFile/body-html-fileflag to the Gmail send command.--body-file, if one already exists.--body-htmland--body-html-filetogether.--body-html.@steipete if this UX is acceptable, say the word and I can prepare a PR.