SaaS CMS has officially launched! Learn more now.

Programmatically add/delete mail categories?



Is it possible to add/delete EPiServer mail categories using code?

We're running EPiServer Mail Administration 4.4.343.20 and as far as we can tellyou can only add categories in the admin GUI.





Nov 12, 2010 10:30

Yes, you can use CategoryHandler in EPiServer Common to do this.

The categories for EPiServer Mail 4.4 are created under the root node (exists each site) named by the value of EPiServerMailModule.Instance.UniqueName.


To get the root node for EPiMail you could do something like

var root = CategoryHandler.GetCategory(theSite, EPiServerMailModule.Instance.UniqueName)

And then use the new Category("mycategoryname", root) constructor to create a new node under it (and commit it using the Add method in CategoryHandler)


Please see the SDK for info on the category system in EPiServer Common (link below is for the version used with Mail 4.4):


(This category structure used in EPiMail has changed slightly in version 5.0 as sites are not part of common there, but the same principle applies that CategoryHandler is used).

Nov 15, 2010 11:12


and thank you for the answer.

Doesn't EPiServer Common require the EPiServer Community Module?

Nov 15, 2010 11:40

EPiServer Common is shared between (and ships with) EPiCommunity and EPiMail.

Nov 15, 2010 12:34

Ah, I see. Thanks!

Nov 15, 2010 12:47
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.