Closed Bug 1749196 Opened 2 years ago Closed 2 years ago

[Compose API] Extend ComposeDetails to include more properties

Categories

(Thunderbird :: Add-Ons: Extensions API, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED
102 Branch

People

(Reporter: myaddons, Assigned: TbSync)

Details

Attachments

(4 files)

The new object ComposeDetails is used in various functions, when interacting with the message being composed, e.g. getComposeDetails(), setComposeDetails(), beginNew(), beginReply(), beginForward().

However, when comparing the current implementation with the possibilities of nsIMsgCompose, nsIMsgComposeParams and nsIMsgCompFields, there are still some essential properties missing. At the moment my own add-on Mail Merge interacts with multiple properties of nsIMsgCompFields, which are not currently supported by ComposeDetails:

contentLanguage
organization
priority
attachVCard
returnReceipt
DSN

In theory ComposeDetails could reflect the complete state of a message, e.g. the message being composed. You could use ComposeDetails to interact with the current compose window using getComposeDetails() and setComposeDetails(). You could use ComposeDetails to open a new compose window using beginNew(), beginReply() and beginForward(). And you could use ComposeDetails to save or send a new message directly using the new send function discussed in Bug 1545930.

There are also two related bugs, which both aim to further extend the properties accessible via ComposeDetails:
Encryption Status in Bug 1732669 and Custom Headers in Bug 1749198

Assignee: nobody → john
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

@Andreas:

  • priority
  • returnReceipt
  • DSN

are no-brainers. But what are

  • organization
  • attachVCard

?

Can those values be set through the UI? Where do they come from?

Is "contentLanguage" the spellcheck language? If not, how can it be set through the UI and what is it used for?

Thanks for your help.

(In reply to John Bieling (:TbSync) from comment #4)

@Andreas

I guess it is me? ;-)

  • priority
  • returnReceipt
  • DSN

Yes, they can be set on a per-message-basis via "Options -> Return Receipt", "Options -> Delivery Status Notification" and "Options -> Priority".

The outgoing message will have the "X-Mozilla-Draft-Info" and "X-Priority" header set, e.g.:

X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=1; DSN=1; uuencode=0; attachmentreminder=0; deliveryformat=4

X-Priority: 2 (High)

  • organization
  • attachVCard

These two can be configured globally in the "Account Settings -> [Account] -> Default Identity". (And in the "Account Settings -> [Account] -> Manage Identities" for additional identities (optional). See attached screenshot "Account Settings.png".

The globally configured vCard can then be attached via "File -> Attach -> Personal Card (vCard)" or via the toolbar button "Attach" on a per-message-basis. (There is no distinct UI element for "organization" in the compose window.)

The outgoing message will have the "X-Mozilla-Draft-Info" and "Organization" header set, e.g.:

X-Mozilla-Draft-Info: internal/draft; vcard=1; receipt=0; DSN=0; uuencode=0; attachmentreminder=0; deliveryformat=4

Organization: Mozilla Thunderbird

Is "contentLanguage" the spellcheck language?

Yes! For example: If you have two dictionaries installed, i.e. "English (United States)" and "German (Germany)", then you can select the spellcheck language via the toolbar button "Spelling". The outgoing message will have the "Content-Language" header set:

Content-Language: en-US

The mentioned field names are part of the nsIMsgCompFields.

Attached image Account Settings.png
Attachment #9273544 - Attachment description: WIP: Bug 1749196 - Expose msgCompFields.priority via compose.ComposeDetails.priority. r=mkmelin → Bug 1749196 - Expose msgCompFields.priority, msgCompFields.returnReceipt and msgCompFields.DSN via compose.ComposeDetails. r=mkmelin

@Alexander Bergmann :

The "organization" setting and the "vCard" setting cannot be changed within the composer. Correct? So instead of manipulating those values here, we should allow to change those values in the identities API.

Do you have a use case, where you need to override those values for individual emails? Should the user not create a second identity if he needs different settings?

(In reply to John Bieling (:TbSync) from comment #7)

The "organization" setting and the "vCard" setting cannot be changed within the composer. Correct?

Yes, the organization setting cannot be changed within the compose window.

No, the vCard setting can be changed within the compose window via the menu entry "File -> Attach -> Personal Card (vCard)" or via the toolbar button "Attach".

First the user needs to configure his vCard via "Edit Card" in the Account Settings as part of the Identity - see "Account Settings.png". Then the user can configure Thunderbird's default behavior by either checking or unchecking the field "Attach my vCard to messages" in the Account Settings as part of the Identity - see "Account Settings.png". (This field only controls Thunderbird's default behavior for new messages.)

On a per-message-basis the user can still override the default behavior in the compose window via the menu entry "File -> Attach -> Personal Card (vCard)" or via the toolbar button "Attach".

The spellcheck setting can be changed within the compose window via the toolbar button "Spelling".

So instead of manipulating those values here, we should allow to change those values in the identities API.

Right, I didn't look into the "identities" API, yet.

From the perspective of my own add-on Mail Merge: I can get the identityID via messenger.compose.getComposeDetails(). Then I can use messenger.identity.get() to get the MailIdentity, which - amongs others - contains the organization. Right? (Then I would not need the organization via ComposeDetails.)

Do you have a use case, where you need to override those values for individual emails? Should the user not create a second identity if he needs different settings?

For my own use-case I need the mentioned fields read-only to pass them to the "Send" API, which - as you know - is still part of my experiment code.

Thanks for your feedback.

Finished already (or being worked on):

  • priority
  • returnReceipt
  • deliveryStatusNotification
  • fcc (Bug 1746348)
  • DeliveryMode
  • attachVCard
  • spell checking language (Bug 1734620)

Missing is still

Am I missing something else?

Edit: Removed File -> attach -> Remind me from the todo list, as it is not related to the composed message.
Edit: Updated list with new patches.

Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/340852d00860
Expose msgCompFields.priority, msgCompFields.returnReceipt and msgCompFields.DSN via compose.ComposeDetails. r=mkmelin
https://hg.mozilla.org/comm-central/rev/a1d4c15d4dc6
Expose msgCompFields.deliveryFormat via compose.ComposeDetails. r=mkmelin
https://hg.mozilla.org/comm-central/rev/c4e1578998f6
Expose msgCompFields.attachVCard via compose.ComposeDetails. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: