Question

I want to enhance my thunderbird (or zarafa), so that i can rightclick on a mail, and get a dialog, where i can fill in some information (like an article reference, an issue number or an invoice) and press "send", and this information alongside with the email and (logged-in) user-information will be sent to another webservice (i.e. a XML-RPC-call, but anything else will also do) which then handles the e-mail (for example attaching the content to the invoice, to the issue resp. the article)? [i need the thunderbird/zarafa part]

thanks for any help (even if it is an answer like "not possible")

Was it helpful?

Solution

This should be quite possible using an extension. First of all you should look into the basics of creating a Thunderbird extension or creating a Mozilla extension in general.

What you then want to do is create an overlay for the context menu, which adds a menuitem that opens your custom dialog. If you use the openDialog method you can pass additional arguments to the dialog, like the currently selected message header (gFolderDisplay.selectedMessage).

From there you can get mail headers, selectedMessage is of the type nsIMsgHdr. Getting the body of the message is a bit more complicated because you have to stream the body and then parse the mime body, but its still possible using the js mime emitter. There are some changes underway that might make this easier in the future, so please double check if there is not an easier way to stream the body.

With that information, you can easily use standard methods (i.e XMLHttpRequest) to send your data to a web service.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top