NotificationsItemDeleted Field |
Namespace: Dynamicweb.News
[Dynamicweb.Extensibility.Subscribe(Dynamicweb.Notifications.NewsV2.ItemDeleted)] public class NewsV2ItemDeletedObserver : Dynamicweb.Extensibility.NotificationSubscriber { public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args) { if (args == null) return; if (!(args is Dynamicweb.NewsV2.Extensibility.NewsItemNotificationArgs)) return; Dynamicweb.NewsV2.Extensibility.NewsItemNotificationArgs news = (Dynamicweb.NewsV2.Extensibility.NewsItemNotificationArgs)args; //send e-mail string emailBody = string.Format("The news (ID:{0}) has been deleted.", news.Item.ID); Dynamicweb.Modules.Common.Email.SendMail("user name", "username@somedomain.dk", "NewsV2ItemDeletedObserver", "admin", Dynamicweb.Mailing.EmailHandler.SystemMailFromAddress(), emailBody, "UTF-8"); } }