Send Email Notification on Page Change

  Previous article Next article  

Send Email Notification on Page Change

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.1.1
  Last updated: 18-11-2017
  Comments: 0
  http://cms.ms/lq5w

This is a User Defined Tag / Event combination that sends an email when a page is changed.

This article originates from the former CMS Made Simple Wiki, the original author wasn't mentioned. I have completly rewritten the UDT code to let it work in current CMSMS release.

User Defined Tag, named "send_email_notification"
$content =& $params['content'];
$editor = $_SESSION['login_user_username'];

$to = 'me@website.com';
$subject = 'Page change notification - ' . $content->Name() . ' - ' . $editor;

$message = "A page on the website has been changed\r";
$message .= "\r";
$message .= "Page Name : " . $content->Name() . "\r";
$message .= "Page Alias : " . $content->Alias() . "\r";
$message .= "Page Type : " . $content->Type() . "\r";
$message .= "Modified by : " . $editor . "\r";
$message .= "Page URL : " . $content->GetURL();

@mail($to, $subject, $message);

  How to use

First, create the UDT above, named send_email_notification. Be sure to change the email address and contact information!

Next, go to Extensions >> Event Manager, click the edit button for ContentEditPost, find your new UDT in the dropdown list, and add it.




CMS Made Simple 2.2.5 - Tutorials, tips and tricks - CMSMS 2.2.5

Send Email Notification on Page Change

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.1.1
  Last updated: 18-11-2017
  Comments: 0
  http://cms.ms/lq5w