November Happy Hour will be moved to Thursday December 5th.

Programmatically add/delete mail categories?

Vote:
 

Hi!

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.

 

//Marcus

 

 

#45671
Nov 12, 2010 10:30
Vote:
 

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):

http://sdk.episerver.com/community/3/html/N_EPiServer_Common_Categories.htm

 

(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).

#45706
Nov 15, 2010 11:12
Vote:
 

Hi,

and thank you for the answer.

Doesn't EPiServer Common require the EPiServer Community Module?

#45708
Nov 15, 2010 11:40
Vote:
 

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

#45723
Nov 15, 2010 12:34
Vote:
 

Ah, I see. Thanks!

#45724
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.