Plugin Developer Discussion

Discussion for FogBugz Plugin developers

IPluginEmailSend

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.
Stefan Rusek Send private email
Wednesday, June 10, 2009
 
 
Why would you need the MailMessage object?  So you can set AlternateViews?
David Fullerton Send private email
Wednesday, June 10, 2009
 
 
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);
Stefan Rusek Send private email
Wednesday, June 10, 2009
 
 
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.
David Fullerton Send private email
Thursday, June 11, 2009
 
 
Any chance of a much simpler interface with just the before callback?
Stefan Rusek Send private email
Thursday, June 11, 2009
 
 
The simpler BeforeEmailSend was what I was looking at.  I didn't even get into what would be needed for EmailSendAfter or EmailSendFailed.
David Fullerton Send private email
Friday, June 12, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz