Magidoc

updateMailDraft
Mutation

Update an existing email draft's subject, body and/or recipients. Omitted fields keep their current value; a provided recipient list replaces the existing list. Attachments and reply headers are preserved, and attachFileIds adds files after the existing attachments. Never sends.

The HTML body is stored exactly as given (links are not rewritten or wrapped); on a reply draft the quoted thread is re-attached below it.

Access: Requires authenticated user with connected mail provider.

Errors:

  • User is not logged in
  • User does not have specified providerId connected
  • Unsupported mail provider
  • Recipient contains a line break

Arguments

#

draftId

ID !
Non-null

providerId

Connected mailbox account id; omit for the user's primary mailbox.

subject

body

Complete HTML body, stored verbatim.

to

Replaces the whole To list.

cc

Replaces the whole Cc list.

bcc

Replaces the whole Bcc list.

attachFileIds

[ID !]

Hive file ids to add as attachments. To attach a local file, upload it with prepareFileLibraryUploads, PUT the bytes, then completeFileLibraryUploads, and pass the returned file ids here; the caller must be able to read each file. At most 20 files and 25 MB in total; Outlook takes files up to 3 MB each.

Response

#

Returns MailMessage .

Example

#