Update draft
update_draftReplace an existing draft. Mail.app cannot edit a saved draft, so this creates the replacement and then deletes the original, so the draft gets a NEW Message-ID, returned as draft_id. Identify the draft with draft_id from list_drafts, or with match_subject / match_to / match_account, which must resolve to exactly one draft. Fields you omit are carried over from the existing draft; attachments is the exception, being the complete new set, so omitting it clears them. This REFUSES a draft that is a reply. The replacement is a new outgoing message and cannot carry In-Reply-To, so updating one would silently break its threading; delete it and call save_reply_draft again with the full text instead. By default the saved draft (new or reply) stays open in a Mail window so the user can review, edit and send it there; the user can turn that off in Keeploop. Pass leave_open=false to save quietly or true to force the window. Omit it to follow the user's setting. left_open says what happened. Recipients must be email addresses. Given only a person's name, look the address up first (search_contacts when it is listed, else search_mail); if more than one person or address could be meant, ask the user. Never guess an address. attachments takes files already in the user's mail as {mail_id, attachment_id} (from get_email or find_attachments; Mail downloads one it has not stored yet), and absolute paths of files in the user's home folder (not hidden ones or ~/Library; from web and phone apps only as the user's Attach files from this Mac permission allows). Up to 18 MB in total. The user sees every file's name and size in the confirmation. Requires Keeploop Pro.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | ||
| body | No | ||
| sender | No | ||
| subject | No | ||
| draft_id | No | ||
| match_to | No | ||
| leave_open | No | ||
| attachments | No | ||
| match_account | No | ||
| match_subject | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| note | No | ||
| account | Yes | ||
| subject | Yes | ||
| draft_id | No | ||
| left_open | No | ||
| attachments | No | ||
| saved_to_drafts | Yes | ||
| replaced_draft_id | No |