CMSMailer example wouldnt work

Post Reply
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

CMSMailer example wouldnt work

Post by cb2004 »

In the help section of the module that example would not work:

$cmsmailer = $this->GetModuleInstance('CMSMailer');

should be:

$cmsmailer = cms_utils::get_module('CMSMailer');
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CMSMailer example wouldnt work

Post by calguy1000 »

incorrect.

Both syntaxes are valid.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
User avatar
airelibre
Dev Team Member
Dev Team Member
Posts: 98
Joined: Tue Dec 01, 2009 3:42 pm
Location: Alsace // France

Re: CMSMailer example wouldnt work

Post by airelibre »

But
$cmsmailer = $this->GetModuleInstance('CMSMailer');

is not deprecated?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CMSMailer example wouldnt work

Post by calguy1000 »

No it's not deprecated.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: CMSMailer example wouldnt work

Post by cb2004 »

Set up a UDT with the example code, ran it, didn't work. Changed the UDT to use cms_utils::get_module('CMSMailer'), ran it, it worked.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: CMSMailer example wouldnt work

Post by calguy1000 »

Of course the example won't work from a UDT. $this->GetModuleInstance() is a module API method.

Issue closed.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Closed Issues”