I find this tip in the Wiki
http://wiki.cmsmadesimple.org/index.php ... age_Change
This is a UDT/Event combination that sends an email when a page is changed. This example uses the CMSMailer module (recommended).
First, create the following UDT named send_email_notification (or whatever name you want). Be sure to change the email address.
global $gCms;
$content =& $params['content'];
$editedby = $gCms->variables['username'];
$bodytext = '
A page on the web site has been changed.
Page Name: '.$content->Name().'
Page Alias: '.$content->Alias().'
Page Type: '.$content->Type().'
Page Created: '.$content->GetCreationDate().'
Modified on: '.$content->GetModifiedDate().'
Modified by: '.$editedby.'
Page URL: '.$content->GetURL();
$cmsmailer =& $gCms->modules['CMSMailer']['object'];
$cmsmailer->AddAddress('your@email.com');
$cmsmailer->SetBody($bodytext);
$cmsmailer->IsHTML(false);
$cmsmailer->SetSubject('Page change notification--' .$content->Name());
$cmsmailer->Send();
Next, go to Extensions->Events, click the edit button for ContentEditPost, find your new UDT in the dropdown list, and ADD it.
The error is:
ERROR DETECTED: Call to a member function AddAddress() on a non-object at /path/lib/classes/class.usertagoperations.inc.php(243) : eval()'d code:18
Someone know where is the problem?
Thanks!
[SOLVED] Send Email Notification on Page Change NOT WORKING
[SOLVED] Send Email Notification on Page Change NOT WORKING
Last edited by joram on Sat Dec 10, 2011 3:12 pm, edited 1 time in total.
Re: [SOLVED] Send Email Notification on Page Change NOT WORK
Care to share how you solved it?...
Re: [SOLVED] Send Email Notification on Page Change NOT WORK
I am getting exactly this problem. CMSMS 1.10.3. The "Send Email Notification on Page Change" UDT/Event was working perfectly on a previous version (1.9.4.1) but when I updated the CMSMS version, I noticed that whenever you save a page a PHP error was created. I switched off the UDT/Event and the page saves fine.
I think this is to do with the dropping support of $gCms which, as you can see in the previous post, appears in the UDT code.
But that's where, at the moment, my knowledge stops.
Anybody?
Thanks
I think this is to do with the dropping support of $gCms which, as you can see in the previous post, appears in the UDT code.
But that's where, at the moment, my knowledge stops.
Anybody?
Thanks
Re: [SOLVED] Send Email Notification on Page Change NOT WORK
Code: Select all
$cmsmailer =& cms_utils::get_module('CMSMailer');
Re: [SOLVED] Send Email Notification on Page Change NOT WORK
Hey joram
I changed
to
and the code now works in 1.10.3. Thank you for posting the solution. 
I changed
Code: Select all
$cmsmailer =& $gCms->modules['CMSMailer']['object'];Code: Select all
$cmsmailer =& cms_utils::get_module('CMSMailer');


