public CreateNotificationPartHandler(IRepository<CreateNotificationPartRecord> repository, IContentNotificationService notificationService)
        {
            _notificationService = notificationService;

            Filters.Add(StorageFilter.For(repository));

            OnCreated<CreateNotificationPart>((context, part) =>
                {
                    var settings = part.Settings.GetModel<CreateNotificationTypePartSettings>();
                    if (settings == null) return;

                    _notificationService.SendNotification(settings, part.ContentItem);
                });

        }
        public PublishNotificationPartHandler(IRepository<PublishNotificationPartRecord> repository, IContentNotificationService notificationService)
        {
            _notificationService = notificationService;

            Filters.Add(StorageFilter.For(repository));

            // Hook into publishing event
            OnPublished<PublishNotificationPart>((context, part) =>
            {
                var settings = part.Settings.GetModel<PublishNotificationTypePartSettings>();
                if (settings == null) return;

                _notificationService.SendNotification(settings, part.ContentItem);

            });
        }
Beispiel #3
0
        public CreateNotificationPartHandler(IRepository <CreateNotificationPartRecord> repository, IContentNotificationService notificationService)
        {
            _notificationService = notificationService;

            Filters.Add(StorageFilter.For(repository));

            OnCreated <CreateNotificationPart>((context, part) =>
            {
                var settings = part.Settings.GetModel <CreateNotificationTypePartSettings>();
                if (settings == null)
                {
                    return;
                }

                _notificationService.SendNotification(settings, part.ContentItem);
            });
        }
 public CreateNotificationPartDriver(IContentNotificationService notificationService)
 {
     _notificationService = notificationService;
 }
 public PublishNotificationPartDriver(IContentNotificationService notificationService)
 {
     _notificationService = notificationService;
 }