Send Email Notification on Page Change
Previous article Next articleThis 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.
$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.
Comment Form
ReviewManager
ReviewManager
12 Comments
Hi! Please tell me the number of your office, I will come to you tomorrow. QGWDYX72CIZXMUHWXF www.yahoo.com
►►► ✅ Where can I pick up my gift? Here? https://lnk.do/oRLXPN
For CMSMS 2, I have modified my UDT FEU_onUserRegistered but I don't receive mail.
Do you see a problem in my code?
------------
global $gCms;
$FEU = $gCms->GetModuleInstance('FrontEndUsers');
# Loop through user properties and add them to $user_props
foreach ($FEU->GetUserProperties($params['id']) as $prop) {
$user_props[$prop['title']] = $prop['data'];
}
# Get email from FEU
$email = $FEU->GetEmail($params['id']);
# Send the mail
$to = 'info@me.org';
$subject = 'Un nouvel utilisateur a créé son compte sur le site';
$message = ''.$email.' (avec le numéro uid '.$params['id'].') vient de créer son compte
Nom :'.$user_props['nom'].'
Prénom :'.$user_props['prenom'].'
Adresse :'.$user_props['adresse'].'
Adresse (suite) :'.$user_props['adresse_suite'].'
Code postal :'.$user_props['cp'].'
Commune :'.$user_props['commune'].'
Téléphone fixe :'.$user_props['tel_fixe'].'
Téléphone mobile :'.$user_props['tel_mobile'].'
';
@mail($to, $subject, $message);
Thanx for this
http://www1.cmscanbesimple.org/blog/send-email-notification-on-page-change
Rolf, do you have a 1.12.x version of the UDT for sending email notifications.
I just want to say that I like your posting. In fact I am using your site regularly. Your articles are very effective and i am very thankful to you for sharing this site with knowledgeable content .
Hi
Like most of these UDT this is a great idea.
But is there any way to isolate administrators from being notified when they make changes or any editor for that matter.
Thanks for all your work.
Dear Rolf,
I would need a UDT like that, but for the News Module, so that at the time of the creation of an article BackEnd, is possible to choose (via Checklist) a list of NMS and send email to a group of people at the time of creation of the article.
Thank you very much
Thanx for this - I really enjoy what you're contributing to the cmsms-community.
Thank You very much for sharing this fine UTD.
- I would like to use this also with News module. How should i modify this UTD for this?
Very useful. Thanks for your work.