[SOLVED] Send Email Notification on Page Change NOT WORKING
Posted: Sat Dec 10, 2011 12:35 pm
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!
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!