Reusing SmtpSettingsPart

Topics: Customizing Orchard
Oct 24, 2013 at 12:50 PM
Hi,

I want to add the SmtpSettingsPart to my own content type.

I have created the content type and attached the SmtpSettingsPart to it, in a migration for my module. And that seems to work just fine.

My problem is that the editor for SmtpSettingsPart isn't rendered when I try to create a content item of my content type. Editors for all other parts attached to the type are rendered correctly.

I have found that my problem is connected to OnGroup("email") that is used in the SmtpSettingsPartDriver. If i remove this the editor for SmtpSettingsPart is rendered correctly for my content type.

So my question is: How do I make my content type belong to the email editor group?


Thanks
Jonas
Coordinator
Oct 26, 2013 at 7:45 AM
Why? Why would you want to do that?
Oct 29, 2013 at 4:28 PM
We need to send some emails from different email accounts.

We've solved this temporarily by storing the different accounts in a config file and implementing a new IMessagingChannel.

We needed a quick fix for this so I thought reusing the smtpSettingsPart would be an easy solution, but apparently it wasn't.

I guess in the long run we'll implement a new part for storing/editing these settings.


Thanks
Jonas
Coordinator
Oct 30, 2013 at 7:26 AM
Don't re-use the SmtpSettingsPart. It was never meant to be re-used for anything else than settings. Create your own, based on that one maybe, but your own.