Skip to Content
Fluxmail

update_draft

Change an existing draft. Fields left out keep their current values. To clear to, cc or bcc, pass an empty list, and to clear the subject, an empty string. bodyText and bodyHtml replace the whole body together, and attachments replaces all of the attachments. To keep the quoted original when you replace a reply draft's body, pass its replyToMessageId again. A quote Fluxmail added earlier is replaced, not repeated.

Change an existing draft. Fields left out keep their current values. To clear to, cc or bcc, pass an empty list, and to clear the subject, an empty string. bodyText and bodyHtml replace the whole body together, and attachments replaces all of the attachments. To keep the quoted original when you replace a reply draft's body, pass its replyToMessageId again. A quote Fluxmail added earlier is replaced, not repeated.

Permissions

Required capabilities: mail.drafts.

Inputs

NameRequiredTypeDetails
draftIdYesstringMinimum length: 1. Maximum length: 512.
accountIdNostring or nullAccount to operate on. Optional when exactly one account is connected. Minimum length: 1. Maximum length: 512.
fromNostring or nullConnected address or an available send-as address Format: email.
toNoarray of string or nullRecipients, each "Name a@x.com" or "a@x.com"
ccNoarray of string or nullRecipients, each "Name a@x.com" or "a@x.com"
bccNoarray of string or nullRecipients, each "Name a@x.com" or "a@x.com"
subjectNostring or nullDefaults to "Re: ..." when replying Maximum length: 998.
bodyTextNostring or nullPlain-text body. Line breaks appear in the sent email. Keep each prose paragraph on one continuous line and separate paragraphs with blank lines.
bodyHtmlNostring or nullHTML body
replyToMessageIdNostring or nullMessage being replied to; threads correctly, quotes it below the body and computes recipients if "to" is omitted. To continue a conversation, reply to the first message get_thread returns with order newest Minimum length: 1. Maximum length: 512.
replyAllNoboolean or nullWith replyToMessageId: reply to all original recipients
timeZoneNostring or nullWith replyToMessageId: IANA time zone, such as America/New_York, for the date above the quoted message. Defaults to the time zone setting. Minimum length: 1. Maximum length: 100.
quoteOriginalNoboolean or nullWith replyToMessageId: set to false to leave the original message out of the reply. Defaults to true.
attachmentsNoarray of object or nullNone
attachmentFilesNoarray of object or nullFiles to attach from the attachment folder, read by Fluxmail instead of sent as base64. Prefer this to attachments for files on this computer. They are added to the attachments.
{
  "type": "object",
  "properties": {
    "draftId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512
    },
    "accountId": {
      "description": "Account to operate on. Optional when exactly one account is connected.",
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ]
    },
    "from": {
      "description": "Connected address or an available send-as address",
      "anyOf": [
        {
          "type": "string",
          "format": "email"
        },
        {
          "type": "null"
        }
      ]
    },
    "to": {
      "description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\"",
      "anyOf": [
        {
          "maxItems": 100,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\""
        },
        {
          "type": "null"
        }
      ]
    },
    "cc": {
      "description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\"",
      "anyOf": [
        {
          "maxItems": 100,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\""
        },
        {
          "type": "null"
        }
      ]
    },
    "bcc": {
      "description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\"",
      "anyOf": [
        {
          "maxItems": 100,
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "description": "Recipients, each \"Name <a@x.com>\" or \"a@x.com\""
        },
        {
          "type": "null"
        }
      ]
    },
    "subject": {
      "description": "Defaults to \"Re: ...\" when replying",
      "anyOf": [
        {
          "type": "string",
          "maxLength": 998
        },
        {
          "type": "null"
        }
      ]
    },
    "bodyText": {
      "description": "Plain-text body. Line breaks appear in the sent email. Keep each prose paragraph on one continuous line and separate paragraphs with blank lines.",
      "type": [
        "string",
        "null"
      ]
    },
    "bodyHtml": {
      "description": "HTML body",
      "type": [
        "string",
        "null"
      ]
    },
    "replyToMessageId": {
      "description": "Message being replied to; threads correctly, quotes it below the body and computes recipients if \"to\" is omitted. To continue a conversation, reply to the first message get_thread returns with order newest",
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 512
        },
        {
          "type": "null"
        }
      ]
    },
    "replyAll": {
      "description": "With replyToMessageId: reply to all original recipients",
      "type": [
        "boolean",
        "null"
      ]
    },
    "timeZone": {
      "description": "With replyToMessageId: IANA time zone, such as America/New_York, for the date above the quoted message. Defaults to the time zone setting.",
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        {
          "type": "null"
        }
      ]
    },
    "quoteOriginal": {
      "description": "With replyToMessageId: set to false to leave the original message out of the reply. Defaults to true.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "attachments": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "filename": {
                "description": "Required with content",
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "mimeType": {
                "description": "Required with content",
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "content": {
                "description": "base64",
                "type": "string"
              },
              "contentId": {
                "description": "With content: Content-ID for an inline image, referenced from bodyHtml as cid:<contentId>",
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "disposition": {
                "description": "With content: defaults to attachment",
                "type": "string",
                "enum": [
                  "inline",
                  "attachment"
                ]
              },
              "messageId": {
                "description": "Instead of content: a message in this mailbox with the attachment to include. Requires mail.read",
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              },
              "attachmentId": {
                "description": "With messageId: the attachment ID from get_email",
                "type": "string",
                "minLength": 1,
                "maxLength": 512
              }
            },
            "additionalProperties": false,
            "description": "Give content with a filename and mimeType, or messageId and attachmentId"
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "attachmentFiles": {
      "description": "Files to attach from the attachment folder, read by Fluxmail instead of sent as base64. Prefer this to attachments for files on this computer. They are added to the attachments.",
      "anyOf": [
        {
          "maxItems": 20,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1024,
                "description": "Path relative to the attachment folder"
              },
              "filename": {
                "description": "Defaults to the file name",
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "mimeType": {
                "description": "Defaults to the type for the file extension",
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "contentId": {
                "description": "Content-ID for an inline image, referenced from bodyHtml as cid:<contentId>",
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              "disposition": {
                "description": "Defaults to attachment",
                "type": "string",
                "enum": [
                  "inline",
                  "attachment"
                ]
              }
            },
            "required": [
              "path"
            ],
            "additionalProperties": false
          }
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "draftId"
  ],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false
}

Last updated

On this page