Plugin Developer DiscussionDiscussion for FogBugz Plugin developers |
||
Basically this would be an interface that works like IPlugin*Commit interfaces.
interface IPluginEmailSend { void EmailSendBefore(System.Net.Mail.MailMessage msg); void EmailSendAfter(System.Net.Mail.MailMessage msg); void EmailSendFailed(System.Net.Mail.MailMessage msg); } It would be conceivable that to take parameters (CBug, CBugEvent, System.Net.Mail.MailMessage) instead of just System.Net.Mail.MailMessage, but it wouldn't be required. Any changes to the MailMessage object in the Before handler would change how the message was sent. This would along with the new bugview interface would make a markdown plugin possible. Though a markdown plugin only needs the Before handler, I can think of other cool plugins that might want the after and failed handlers.
To set the body to be html and set the html body boolean, and possibly alternate views.
A plugin might also want to add extra headers or modify a header. For just the markdown plugin, it might be a tad overkill, but it doesn't seem unreasonable to have access to actual MailMessage object. I suppose it would have to be serialized across the app domain boundary. So the signature might need to be. MailMessage EmailSendBefore(MailMessage msg);
I spent some time looking into this and it unfortunately looks very non-trivial given the state of our mail handling, which means it's not going to make it in for FogBugz 7.
This probably means that it's not possible to write a markup plugin that works for emails. Better interfaces and APIs for email handling is something we'll look into for the next version of the plugin architecture. |
Powered by FogBugz