Accessing CSModule stored in communityserver.config

Accessing CSModule stored in communityserver.config

This question has suggested answer(s)

I have extended my Email template using IEmailTemplateExtension. Which is fine till now.

I wanted to access the communityserver.config file to access my configuration related to CSModules.

How i can access this ?

All Replies
  • Sabir, are you trying to access the configuration for a  custom CSModule? I'm not sure what you are trying to do so I don't know what advice to give you or where to direct you for assistance. Please provide a little more detail so I may be of better assistance.

  • Dan,

    Thanks for your reply.

    To give an overview.

    1.) I have my custom CSModule defined in the CSModule section of communitserver.config file which has some additional key in it like serverAddress="http://abc.com/mywidget"

    2.) I have created my Emailextension Class to extend the email content before send email which is all good.

    3.) within my Emailextension class I want to access the "serverAddress" defined in the communitserver.config for my custom CSModule.

    I hope i explainged my scenario.

    So any suggesstion on how i can access it?

  • I don't think there is anything available to access the configuration file after the module has already been loaded. You could go about this a couple of ways. The communityserver.config file is an XML file, you could read it and parse that info yourself, but I wouldn't recommend it. When the CSModule loads you could store that information in some sort of data storage where it can be accessed by other code. This could involve some other class to get/store/retrieve that data. Another option would be to add some instance or static method to your CSModule that exposes that property to your email extension class. I'm sure there are other ways it could be done.