Kentico CMS 6.0 Developer's Guide

Subscribing users to content changes notifications

Subscribing users to content changes notifications

Previous topic Next topic Mail us feedback on this topic!  

Subscribing users to content changes notifications

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

The Content subscription web part is a pre-configured version of the Notification subscription web part. It can be conveniently used to let site visitors subscribe to notifications about the following three events:

 

Document has been created

Document has been updated

Document has been deleted

 

devguide_clip0674

 

In the following example, you will learn how to add the Content subscription web part to your site and set it up. We will use the Corporate site sample website as the starting point. Let's presume that we want to enable site visitors to receive an e-mail whenever a new product is added.

 

 

 

Please note

 

In order for you to see the full functionality, it is necessary to have a SMTP server configured correctly. For more information on how to do this, please refer to the SMTP server configuration chapter.

 

 

1. Sign in to CMS Desk as the global administrator (login administrator with blank password by default). From the content tree on the left, select the Products title page and switch to the Design tab.

 

2. Add the Content subscription web part to the zoneLeft web part zone, below the Left tree menu. In the Web part properties dialog, set the following properties:

 

Site name - (current site)

Path - /Products/%

Document type - CMS.Product

Event description - Enter your e-mail address to receive notifications about new products:

 

Gateway names - CMS.EmailGateway

Notification preferred format - HTML

 

Create event enabled - true

Create event display name - New product notification

Create event template name - MyTemplate

 

and click OK.

 

 

 

Please note

 

It is important that the template you have recently created according to the Creating a notification message template topic is global or assigned to the current site.

 

 

devguide_clip0675

 

3. Let's switch to the site visitor's perspective now. Sign out of CMS Desk.

 

As notifications are available only for registered users, the web part is not visible unless you log in. Use the My account link at the top of the page to display a logon form and sign in; use e.g. user name Gold with blank password. Once signed in, switch to the Products page. You should see the Content subscription web part underneath the tree menu as highlighted in the screenshot below.

 

If you want to receive notifications about new products on this page, you can just type in your e-mail address into the E-mail field and click Subscribe. In case that you want to verify the functionality later on, enter your own e-mail address so that you can check your inbox for notification e-mails.

 

devguide_clip0676

 

4. You can immediately verify your subscription by going to the My account section again. If you switch to the Notifications section of the My account web part, you should see the notification subscription present.

 

devguide_clip0677

 

5. Now you can verify that the whole setup works. Log in to CMS Desk as the administrator again. From the content tree, select Products and click the NewDocument New icon above the content tree. Choose to create some new product, e.g. a Cell phone, enter some sample data about the cell phone and click Save Save. Check your e-mail inbox in a few minutes. You should have received a new notification message about the newly added product.