CLI: Sending

The commands of the doorman command line under Sending. New messages and replies from an inbox, with idempotent retries.

doorman inboxes send

Command

doorman inboxes send <inboxId> [flags]

Sends inboxes.send: POST /v1/inboxes/{inboxId}/send

Send a message or reply. Access any: any API key, or a console session. An app token needs mail:send and mail:read.

Flags
  • --inbox-idstringoptional

    The same as the argument <inboxId>, for a script that names everything.

  • --idempotency-keystringoptional

    1 to 255 printable ASCII characters. For 24 hours the same key with the same request replays the original answer with Idempotent-Replayed: true; the same key with a different request is refused with 422 idempotency_key_reused; a key whose first attempt is still running answers 409 idempotency_in_progress; a failed send releases the key.

  • --tostring | string[]optional

    Recipients. Optional on a reply, where it defaults to the last inbound message's Reply-To or sender.

  • --ccstring | string[]optional

  • --bccstring | string[]optional

  • --reply-tostringoptional

    The address replies should go to instead of the inbox.

  • --subjectstringoptional

    Required on a new message. A reply defaults to Re: <thread subject>.

  • --textstringoptional

    The plain-text body.

  • --htmlstringoptional

    The HTML body. Text is derived from it when text is absent.

  • --bodystringoptional

    A convenience: treated as HTML when it looks like HTML, as text otherwise. Ignored when text or html is given.

  • --thread-idstringoptional

    A thread id (thr_...). Makes the message a reply in this thread: threading headers, the default subject and recipient, and the quoted previous message come from it. An unknown, foreign or trashed thread answers 404 thread_not_found.

  • --include-quotebooleanoptional

    On a reply, quote the previous message under the text. Defaults to true.

  • --attachmentsobject[]optional

  • --jsonobjectoptional

    The request body as one JSON object. A flag given beside it replaces the field of the same name.

Example

doorman inboxes send inb_01jc4q7w9k2m5n8p3r6t1v4x7z \
  --to sam@example.com \
  --subject Thursday \
  --text 'Thursday works.'

doorman inboxes drafts create

Command

doorman inboxes drafts create <inboxId> [flags]

Sends inboxes.drafts.create: POST /v1/inboxes/{inboxId}/drafts

Write a draft for the owner to send. Access key: an API key, or a correctly scoped app token where delegated access is allowed; console sessions are refused. An app token needs mail:draft and mail:read.

Flags
  • --inbox-idstringoptional

    The same as the argument <inboxId>, for a script that names everything.

  • --tostring | string[]optional

    Recipients. Optional on a reply, where it defaults to the last inbound message's Reply-To or sender.

  • --ccstring | string[]optional

  • --bccstring | string[]optional

  • --reply-tostringoptional

    The address replies should go to instead of the inbox.

  • --subjectstringoptional

    Required on a new message. A reply defaults to Re: <thread subject>.

  • --textstringoptional

    The plain-text body.

  • --htmlstringoptional

    The HTML body. Text is derived from it when text is absent.

  • --bodystringoptional

    A convenience: treated as HTML when it looks like HTML, as text otherwise. Ignored when text or html is given.

  • --thread-idstringoptional

    A thread id (thr_...). Makes the message a reply in this thread: threading headers, the default subject and recipient, and the quoted previous message come from it. An unknown, foreign or trashed thread answers 404 thread_not_found.

  • --include-quotebooleanoptional

    On a reply, quote the previous message under the text. Defaults to true.

  • --attachmentsobject[]optional

  • --jsonobjectoptional

    The request body as one JSON object. A flag given beside it replaces the field of the same name.

Example

doorman inboxes drafts create inb_01jc4q7w9k2m5n8p3r6t1v4x7z \
  --to sam@example.com \
  --subject Thursday \
  --text 'Thursday works.'

doorman drafts delete

Command

doorman drafts delete <heldSendId> [flags]

Sends drafts.delete: DELETE /v1/drafts/{heldSendId}

Take a draft back. Access key: an API key, or a correctly scoped app token where delegated access is allowed; console sessions are refused. An app token needs mail:draft.

Flags
  • --held-send-idstringoptional

    The same as the argument <heldSendId>, for a script that names everything.

Example

doorman drafts delete hsd_01jc5f1a2b3c4d5e6f7g8h9j0k

Up Down to move, Enter to open, Esc to close