mailbox_save_draft
Create or update a plain-text email draft in a mailbox without sending it; adds signature, supports attachments, replies, and forwards.
Instructions
Create or update a plain-text draft in a mailbox without sending it; the draft is written from that mailbox's address. The mailbox signature is added at the end, once, and the message also goes out formatted. A new draft takes expected_revision 0; editing one needs its id and current revision (a stale revision is refused, re-read the draft). To answer or pass on a received message, give its id as source_item_id with mode reply or forward. Attachments: attachments adds files (content_base64 with a filename, or a path inside MEPMAIL_MAIL_UPLOAD_DIR); keep_attachments lists the indexes to keep from the draft being edited or the message being forwarded (default: keep them all; a reply keeps none). Limits: 10 files, 256 KiB each, about 700 KiB in all.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cc | No | Copy (Cc) addresses | |
| id | No | Draft id, when editing an existing draft | |
| to | Yes | Recipient addresses | |
| bcc | No | Blind copy (Bcc) addresses: they receive the message, and no other recipient sees them; To, Cc and Bcc together count up to 20 | |
| mode | No | With source_item_id | |
| text | Yes | Plain-text body | |
| mailbox | No | Mailbox address (or id) from mailbox_list_accounts. Needed when the credential covers several mailboxes and has no default. | |
| subject | Yes | Subject line, one line | |
| attachments | No | New files: { filename, content_base64 } or { path } inside MEPMAIL_MAIL_UPLOAD_DIR | |
| source_item_id | No | Received message this draft replies to or forwards | |
| keep_attachments | No | Attachment indexes to keep from the edited draft or forwarded message | |
| expected_revision | No | 0 for a new draft; the draft's current revision when editing |