maton google-mail message get

maton google-mail message get <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 –format (minimal/metadata/full/raw) and –metadata-header to control Gmail’s users.messages.get query params directly — when –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
--format <string>
Gmail messages.get format: minimal, metadata, full, raw (forces raw JSON output)
--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
--json
Output raw JSON
--metadata-header <strings>
Header to include when --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
-t, --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)

ALIASES

maton gmail messages view, maton google-mail message view, maton google-mail messages view, maton gmail message view

Examples

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

See also