compose¶
This message composition window API first appeared in Thunderbird 67 (see bug 1503423).
Permissions¶
Functions¶
beginNew([messageId], [details])¶
Open a new message compose window. If the provided ComposeDetails object does not provide body, plainTextBody or isPlainText, the default compose format of the used/default identity is used. The accounts API can be used to get the used/default identity and its default compose format.
messageId]beginReply(messageId, [replyType], [details])¶
Open a new message compose window replying to a given message. If the provided ComposeDetails object does not provide body, plainTextBody or isPlainText, the default compose format of the used/default identity is used. The accounts API can be used to get the used/default identity and its default compose format.
messageIdreplyType]Supported values:
replyToSenderreplyToListreplyToAllbeginForward(messageId, [forwardType], [details])¶
Open a new message compose window forwarding a given message. If the provided ComposeDetails object does not provide body, plainTextBody or isPlainText, the default compose format of the used/default identity is used. The accounts API can be used to get the used/default identity and its default compose format.
messageIdforwardType]Supported values:
forwardInlineforwardAsAttachmentgetComposeDetails(tabId)¶
Fetches the current state of a compose window. Currently only a limited amount of information is available, more will be added in later versions.
tabIdsetComposeDetails(tabId, details)¶
Updates the compose window. Specify only fields that you want to change. Currently only the to/cc/bcc/replyTo/followupTo/newsgroups fields and the subject are implemented. It is not possible to change the compose format.
tabIddetails.body, details.plainTextBody or details.isPlaintext will fail if the compose format of the compose window does not match. Use getComposeDetails(tabId) to get the current compose format.listAttachments(tabId)¶
Lists all of the attachments of the message being composed in the specified tab.
tabIdaddAttachment(tabId, data)¶
Adds an attachment to the message being composed in the specified tab.
tabIddataname]file object is used.updateAttachment(tabId, attachmentId, data)¶
Renames and/or replaces the contents of an attachment to the message being composed in the specified tab.
tabIdattachmentIddataname]file object is used.removeAttachment(tabId, attachmentId)¶
Removes an attachment from the message being composed in the specified tab.
tabIdattachmentIdEvents¶
onBeforeSend(tab, details)¶
Fired when a message is about to be sent from the compose window. This is a user input event handler. For asynchronous listeners some restrictions apply.
cancel]onAttachmentAdded(tab, attachment)¶
Fired when an attachment is added to a message being composed.
onAttachmentRemoved(tab, attachmentId)¶
Fired when an attachment is removed from a message being composed.
onIdentityChanged(tab, identityId)¶
Fired when the user changes the identity that will be used to send a message being composed.
Types¶
ComposeAttachment¶
Represents an attachment in a message being composed.
idnamesizegetFile()Retrieves the contents of the attachment as a DOMFileobject.
ComposeDetails¶
Used by various functions to represent the state of a message being composed. Note that functions using this type may have a partial implementation.
attachments]body]identityId]replyTo is also specified, the replyTo property of the identity is overridden. The permission is required to include the identityId.isPlainText]newsgroups]plainTextBody]subject]type]Read-only. The type of the message being composed, depending on how the compose window was opened by the user.
Supported values:
draftnewreplyforwardComposeRecipient¶
OR
idtypeWhich sort of object this ID is for.
Supported values:
contactmailingList