maton google-mail message view

maton google-mail message view <message-id> [flags]

Fetch a Gmail message and print its body. Defaults to plain text; use –html to print the HTML alternative when available, –headers to prepend a From/To/Cc/Subject/Date block, or –raw to dump the raw API JSON. Use –fetch-format (minimal/metadata/full/raw) and –metadata-header to control Gmail’s users.messages.get query params directly — when –fetch-format is set, the raw API response is printed and body parsing is skipped.

Options

--connection <string>
Connection ID to route through (Maton-Connection header)
--dry-run
Print the request that would be sent without executing it
--fetch-format <string>
Gmail messages.get format: minimal, metadata, full, raw (forces raw JSON output)
--format <string>
Output format: 'json' (default) or 'text' on supported commands
--headers
Print From/To/Cc/Subject/Date before the body
--html
Print the HTML body instead of plain text
-q, --jq <expression>
Filter JSON output using a jq expression
--metadata-header <strings>
Header to include when --fetch-format=metadata (repeatable or comma-separated, e.g. From,Subject,Date)
--paginate
Follow next_cursor and concatenate all pages (list commands only)
--raw
Print the raw users.messages.get response as JSON
--template <string>
Format JSON output using a Go template; see "maton help formatting"

Options inherited from parent commands

-p, --profile <string>
Profile to use for this invocation (overrides the active profile; also reads MATON_PROFILE)

Examples

$ maton google-mail message view 18f1a2b3c4d
$ maton google-mail message view 18f1a2b3c4d --headers
$ maton google-mail message view 18f1a2b3c4d --raw --format json
$ maton google-mail message view 18f1a2b3c4d --fetch-format metadata --metadata-header From,Subject,Date

See also