Closed Bug 1959939 Opened 7 months ago Closed 13 hours ago

Pass ComposeDetails to messenger.compose.onAfterSend Listener

Categories

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

Thunderbird 128
enhancement

Tracking

(Not tracked)

RESOLVED FIXED
147 Branch

People

(Reporter: WoofGrrrr, Assigned: john)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:137.0) Gecko/20100101 Firefox/137.0

Steps to reproduce:

In the code for my Web Extension, I tried to get the ComposeDetails in my messenger,compose.onAfterSend listener. The listener is passed a Tab object, and I got the ID from the Tab to call messenger.compose.getComposeDetails(tabId).

Actual results:

getComposeDetails() returned undefined

Expected results:

It should return a ComposeDetails with the information that was used when the message was actually sent.

I posted about this on the Add-on Developers Topicbox and it was suggested that I open a request to instead pass the ComposeDetails directly to the onAfterSend listener.

Yes, I can save the ComposeDetails -- whatever data from it that I need -- when the onBeforeSend is called, but onBeforeSend can be called multiple times before a message is actually sent. And the message may ultimately not even be sent. And saving things for later is sort of a pain when the API could make things easier.

There are fields in ComposeDetails that may be quite useful to an onAfterSend listener.

In my case I want the identityId in order to get the accountId and thus the Account from which the message was sent. This way I can know which SMTP server was used, amongst other things. I can't think of any way to get this other than the ComposeDetails.

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

Thanks for suggesting this feature. We, too, think it is useful.

Target Milestone: --- → 147 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/78a0cbb73026
Pass ComposeDetails to compose.onAfter* listeners. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 13 hours ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: