为 Thunderbird 或 Zarafa 创建自己的插件?
我想增强我的 Thunderbird(或 zarafa),以便我可以右键单击邮件,然后出现一个对话框,我可以在其中填写一些信息(如文章参考、问题编号或发票),然后按“发送” ,并且此信息与电子邮件和(登录的)用户信息一起将被发送到另一个 Web 服务(即 XML-RPC 调用,但也可以执行其他任何操作),然后该 Web 服务处理电子邮件(例如附加发票的内容、问题或文章)? [我需要雷鸟/扎拉法部分]
感谢您的任何帮助(即使是“不可能”之类的答案)
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")
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用扩展应该可以实现这一点。 首先,您应该了解 创建Thunderbird 扩展 或一般创建 Mozilla 扩展。
然后您要做的是创建一个 叠加层对于上下文菜单,它添加一个打开自定义对话框的菜单项。 如果使用
openDialog
方法,您可以向对话框传递其他参数,例如当前选定的消息标头 (gFolderDisplay.selectedMessage
)。从那里您可以获取邮件标头,selectedMessage 的类型为 nsIMsgHdr。 获取消息正文有点复杂,因为您必须流式传输正文,然后解析 mime 正文,但仍然可以使用 js mime 发射器。 正在进行的一些更改可能会使将来变得更容易,因此请仔细检查是否没有更简单的方法来传输正文。
有了这些信息,您就可以轻松地使用标准方法(即 XMLHttpRequest)将数据发送到 Web 服务。
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.