Table of Contents

Notifications

Notifications are events that are happening in the DynamicWeb platform, that you can subscribe to, and thereby affect how the system behaves or use it to notify an external system about the change. These notifications are fired from many different places in DynamicWeb, and this means that you can hook into the functionality in the following places:

In these places you can see all the notifications, which we support right now in the different areas. Under the individual notifications, you can find examples for how this can be implemented.

In general, when you want to implement a Notification Subscriber, you need to create a new class, which inherits from NotificationSubscriber. This ´NotificationSubscriber´ class has this overridable method ´OnNotify´, which is called every time an event is fired.

To limit the notification subscriber to a specific event, you need to decorate the class with the Subscribe attribute, where the specific event name is passed to the attribute.

using Dynamicweb.Extensibility.Notifications;

namespace Examples
{
    [Subscribe(Dynamicweb.Notifications.Standard.Page.OnBeforeSave)]
    public class BasicNotificationSample : NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
            base.OnNotify(notification, args);
        }
    }
}
To top