Save a draft in Gmail without opening a window, new or as a reply. It never sends.
Usage
briskmail save-draft [--to <addresses>] [--cc <addresses>] [--bcc <addresses>] [--subject <text>] [--body <text> | --body-file <path>] [--attach <path> ...] [--json]
briskmail save-draft --reply-to <message-id> [--all] [--body <text> | --body-file <path>] [--attach <path> ...] [--json]Every --attach file is read before anything is saved. If one is missing or unreadable, no draft is saved. Check what arrived with briskmail attachments and the printed draft id. With --reply-to the draft is the reply the Reply button would start: in that message's thread, addressed to its sender, with a Re: subject and their message quoted below yours. --to, --cc, --bcc and --subject replace those prefilled values.
Runs only while Let apps read and organize my mail is on. With it off, the command exits 2 and names the switch.
Arguments and flags
--reply-to MESSAGE_ID- Save a reply to this message, in its thread, with it quoted below.
--all- With --reply-to: reply to everyone on the message.
--to ADDRESSES- To recipients.
--cc ADDRESSES- Cc recipients.
--bcc ADDRESSES- Bcc recipients.
--subject TEXT- Subject.
--body TEXT- Plain text body.
--body-file PATH- Read plain text body from a file or stdin (-).
--attach PATH- Attach a file, keeping its name. Give it once per file. Attachments are capped at Gmail's 25 MB in total.
--json- Print one JSON document with draftId and messageId.
Global flags
--account ID- An account id, as briskmail accounts prints it. Leave it out to use the first account. Accepted before or after the command.
--dev- Send the command to the dev build (com.valleyedgeconsulting.edgemail.dev) instead of Briskmail. Only useful when working on Briskmail itself.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Done. Prints the new draft's id. |
| 2 | Not allowed: macOS refused Automation for the app you ran it from (-1743), or this command's switch is off. The message names the switch. |
| 3 | Briskmail reported an error, printed on stderr. |
| 64 | Bad usage, such as an --attach file that is missing or unreadable. Nothing is saved. |
Examples
briskmail save-draft --to dana@example.com --subject Hello --body Hi
r-4823019577301845123briskmail save-draft --to dana@example.com --subject "Wiring" --body-file note.txt --attach "X12 system diagram - 1 wiring (draft).pdf" --attach quote.pdf
r-4823019577301845124Then briskmail attachments r-4823019577301845124 lists both files with their sizes.
briskmail save-draft --reply-to 19a2b3c4d5e6f708 --body "Thanks, attached." --attach resume.pdf
r-1234567890