Skip to content

Latest commit

 

History

History
161 lines (100 loc) · 3.3 KB

messages.rst

File metadata and controls

161 lines (100 loc) · 3.3 KB

messages

The messages API first appeared in Thunderbird 66 (see bug 1488176).

Permissions

  • messagesRead "Read your email messages and mark or tag them"

Note

The permission messagesRead is required to use messages.

Functions

list(folder)

Gets all messages in a folder.

Returns a Promise fulfilled with:

continueList(messageListId)

Returns the next chunk of messages in a list. See :doc:`how-to/messageLists` for more information.

  • messageListId (string)

Returns a Promise fulfilled with:

get(messageId)

Returns a specified message.

  • messageId (integer)

Returns a Promise fulfilled with:

getFull(messageId)

Returns a specified message, including all headers and MIME parts.

  • messageId (integer)

Returns a Promise fulfilled with:

update(messageId, newProperties)

Marks or unmarks a message as read, starred, or tagged.

  • messageId (integer)
  • newProperties (object)
    • [flagged] (boolean) Marks the message as starred or unstarred.
    • [read] (boolean) Marks the message as read or unread.
    • [tags] (array of string) Sets the tags on the message. For a list of available tags, call the listTags method.

listTags()

Returns a list of tags that can be set on messages, and their human-friendly name, colour, and sort order.

Returns a Promise fulfilled with:

Types

MessageHeader

object

  • author (string)
  • bccList (array of string)
  • ccList (array of string)
  • date (date)
  • flagged (boolean)
  • folder (:ref:`accounts.MailFolder`)
  • messageId (integer)
  • read (boolean)
  • recipients (array of string)
  • subject (string)
  • tags (array of string)

MessageList

See :doc:`how-to/messageLists` for more information.

object

MessagePart

Represents an email message "part", which could be the whole message

object

  • [body] (string) The content of the part
  • [contentType] (string)
  • [headers] (object) An object of part headers, with the header name as key, and an array of header values as value
  • [name] (string) Name of the part, if it is a file
  • [partName] (string)
  • [parts] (array of :ref:`messages.MessagePart`) Any sub-parts of this part
  • [size] (integer)

MessageTag

object

  • color (string) Tag color
  • key (string) Distinct tag identifier – use this string when referring to a tag
  • ordinal (string) Custom sort string (usually empty)
  • tag (string) Human-readable tag name