MENU

Send Email Notification on Page Change

  Previous article Next article  

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.


Buy Me A Coffee


  Comment Form

Click here to open the form


  10 Comments

Buy Me A Coffee

CMS Made Simple - Tutorials, Tips and Tricks - CMSMS

Send Email Notification on Page Change

  Article optimized for CMSMS 2.x

  Author:
  Last tested in: CMSMS 2.1.1
  Last updated: 10-06-2019
  Comments: 10
  http://cms.ms/lq5w


Buy Me A Coffee




Advertisement


Ads help me to help you! Buy products from these advertisers!