i was creating a page for automatic removal of the users acording to conditions
then i wanted to send to this user an email telling him that his user got deleted
but i can't find a way to access the DefaultEmailService
can you help me
public class RemovalUsersBaseModule: ModuleBase
{
IEmailService _emailservice;
public WebUserModule( IEmailService emailservice)
{
this._emailservice=emailservice;
}
public void SendEmail(params)
{
return this._emailservice.ProcessEmail(params);
}
}
public class RemovalUsersAdminPage : ModuleAdminBasePage
{
RemovalUsersBaseModule _module;
private void Page_Load(object sender, System.EventArgs e)
{
this._module = base.Module as RemovalUsersBaseModule;
}
public RemoveUsers( )
{
this._module.SendEmails(params);
}
}
i have tried that
but the problem is that i cam not creating a new module
i am adding a page in the
Cuyahoga.Web.Admin
and this pages do not inherit ModuleAdminBasePage nor BaseModuleControl but inherit AdminBasePage
which does not include definition for module to help me define a new one
You can obtain an instance of IEmailService via:
public class MyAdminPage
{
private IEmailService _emailService;
public MyAdminPage()
{
this._emailService = Container.Resolve[IEmailService]();
}
}
(and replace the square brackets with angled brackets)
thanks martijnb
it worked