compose.sendMessage should have an option not to close the compose window after sending
Categories
(Thunderbird :: Add-Ons: Extensions API, enhancement)
Tracking
(Not tracked)
People
(Reporter: siefkenj, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0
Steps to reproduce:
I work on a mailmerge extension for Thunderbird. I am trying to remove the last of the experimentAPI components. However, the compose.sendMessage API isn't yet adequate.
I need to replace the content of a message, send it, then replace the content again, and repeat this procedure. The trouble is, calling sendMessage closes the window when it is called. This means the extension cannot reuse the message and the user cannot edit the message again when the extension has finished.
Expected results:
The options object for sendMessage could be extended to include a closeWindowOnComplete option. Or perhaps there is another API I don't know that allows one to clone a compose window so that it can be "closed" without messing up the original?
Comment 1•4 years ago
|
||
If you had an API to send a message without using the compose window at all, would that work?
Yes! It would be great if there were a compose.beginNewHeadless or beginNewBackground with an option to clone the contents of an existing message (so that one wouldn't have to download all the attachments and reattach them, etc.)
Comment 3•4 years ago
|
||
What is your workflow? Do you need the open composer or does your add-on work with an existing message or draft? Do your users:
a) open the composer to create the template and initiate the send of the different mails for the open message?
b) pick an already created draft and that will be used to send the different mails?
c) ?
For a) the background send could use a ComposeDetails object and an array of ComposeAttachment objects as input, would that work for you?
I am currently investigating how to implement the send function. See Bug 1545930.
Can I close this as a dupe of bug 1545930?
My extension uses a compose window. The workflow is most similar to a). I believe this is very close to bug 1545930.
Comment 5•4 years ago
|
||
We will have to find different ways to achieve what you want. For now I think a compose window should always close after the message has been successfully send. An initiated background send of a clone of the currently composed message seems the way to go (bug 1545930). I think you should be able to clone the message already and use compose.send() on the clone to send it. It will flash an additional compose window, but it should do what you need.
Description
•