I was able to move my config settings out of the web config file by
overrideing the GetConfig() method. After doing some testing, this
did't quite get me the result I was looking for.
The last piece I am looking for is a way for the Email module to look
at the config when a error occurs and and email is generated. That
way if the config settings are changed through the UI, the entire
application doesn't need to be restarted in order for the changes to
take effect.
It looks like the GetConfig happens during OnInit. Would it be
possible to move this call to someplace else in the module so it gets
called at runtime?
Thanks
Nik
On Aug 20, 1:51 am, Atif Aziz <
Atif.A...@skybow.com> wrote:
> Nik,
>
>
>
> I am wondering if anyone has ever pulled in the configuration settings
> for the SMTPemailforELMAHfrom an external source. It could be
> from an XML file, method, or database.
> <<
>
> This is possible today by inheriting from ErrorMailModule and overriding its GetConfig method. Next, you register your derived module instead of the base one fromELMAH.
>
>
>
> I am wanting to implement a UI of some sort to allow an Admin to enter
> in the SMTP server information, set up the default subject and
> recipient. Then feed that to the web.config for forELMAHto use.
> <<
>
> You could just -write the new settings to web.config and they'll be picked up on restart. The restart is important in order for the module to pick up the refreshed configuration since modules are initialized at application start-up time.
>
> - Atif
>
>
>
> -----Original Message-----
>
From:el...@googlegroups.com [mailto:
el...@googlegroups.com] On Behalf Of Nik
> Sent: Wednesday, August 20, 2008 4:46 AM
> To:ELMAH
> Subject: [ELMAH] Setting up STMPemailin web.config based on external source
>
> I am wondering if anyone has ever pulled in the configuration settings
> for the SMTPemailforELMAHfrom an external source. It could be
> from an XML file, method, or database.
>
> I am wanting to implement a UI of some sort to allow an Admin to enter
> in the SMTP server information, set up the default subject and
> recipient. Then feed that to the web.config for forELMAHto use.
>
> Any suggests would be appreciated.
>
> Thanks
> Nik- Hide quoted text -
>
> - Show quoted text -