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: 20-01-2016
  Comments: 10

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.


A2 Webhosting CMS Made Simple

  Comments

  Click here to leave a comment






This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)
  « Enter the CAPTCHA code (lower case)

Your IP address will be stored on submit. I reserve the right to change or delete your response without notice!
In case of abuse your IP address will be blocked!


Can I have your attention for a moment?

Did this tutorial help you solving a problem at your (clients) website and it saved you many hours of work? Great!!
Consider buying Rolf a cup of coffee in return! [ Click here ]


  10 Comments

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

Send Email Notification on Page Change

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.1.1
  Last updated: 20-01-2016
  Comments: 10

A2 Webhosting CMS Made Simple