Handle message attachments in browser.compose API functions
Categories
(Thunderbird :: Add-Ons: Extensions API, enhancement)
Tracking
(Not tracked)
People
(Reporter: darktrojan, Assigned: darktrojan)
References
Details
Attachments
(2 files)
90.60 KB,
image/png
|
Details | |
43.03 KB,
patch
|
mkmelin
:
review+
|
Details | Diff | Splinter Review |
-
Could the attachments be saved as a template attachment, i.e the file name being:
{{attach_1}}
{{attach_2}}
...
{{attach_n}}
Where the {{attach_x}} could be empty? -
Could the {{attach_x}} also be an set of attachments?
This could help with the Mail Merge add-on as then the attachment could be stored with the email. This could help stop accidentally sending emails with attachment from other mail merges.
What do you think?
Thank you
Assignee | ||
Comment 2•3 years ago
|
||
I'm not sure that I completely understand what you're asking for, but I'll explain what I have in mind at the moment as that might help.
- A
listAttachments
function which returns the attachments asFile
objects. I'm not sure ifFile
does everything we need it to but I think it covers most bases: name, size, contents. There's also the question about what to do with FileLink attachments. I don't know, but the answer could be useful for comment 1. I had in mind that the attachments would be automatically listed in theonBeforeSend
event and other events, but now I'm not so sure. - An
addAttachment
function. If we're usingFile
this would be great for extension-generated attachments. For using files from the filesystem, we'll first need to figure out what we're doing in terms of filesystem access APIs. There's discussion about that elsewhere so I won't go into it. - A
removeAttachment
function and (I guess) anupdateAttachment
function. - A
onAttachmentAdded
/Removed
/other events, maybe. I'm not sure how useful it would be to know when attachments are removed from a draft.
Bug 1468704 Enable attaching a Template when creating a message
Please see the image Template in the attach bucket
Comment 4•3 years ago
|
||
When referencing bugs, please just use "bug" and the number so bugzilla can autolink them properly.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 6•3 years ago
|
||
Comment 7•3 years ago
|
||
Comment on attachment 9145732 [details] [diff] [review] 1613535-api-attachments-1.diff Review of attachment 9145732 [details] [diff] [review]: ----------------------------------------------------------------- I wonder if we should accept Blob too
Assignee | ||
Comment 8•3 years ago
|
||
The only difference would be that you don't have to provide a file name, but you have to provide a name for the attachment (one way or another) anyway.
Have we understood correctly that this would enable fields, eg. {{field_name}} and image shown in https://bugzilla.mozilla.org/show_bug.cgi?id=1613535#c3, to be provided as a name for the attachment without providing a file name?
This would be fantastic for the Mail Merge feature.
Thank you
Assignee | ||
Comment 10•3 years ago
|
||
You'll be able to add attachments with a custom name, or rename existing ones to have a custom name, so yes, I think this can do what you want.
Comment 11•3 years ago
|
||
Pushed by thunderbird@calypsoblue.org:
https://hg.mozilla.org/comm-central/rev/10edd0b97102
Handle message attachments in browser.compose API functions. r=mkmelin
Updated•3 years ago
|
Comment 12•3 years ago
|
||
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/d99e95524b9b followup to fix linting. rs=eslint DONTBUILD
Comment 13•3 years ago
|
||
Pushed by geoff@darktrojan.net: https://hg.mozilla.org/comm-central/rev/2a5f7a05bc2c follow-up - Fix "this.forgetAttachment is not a function" when closing compose window. rs=me DONTBUILD
Description
•