Beispiel #1
0
        public void PublishNotification(IEnumerable <Notification> notifications, INotificationRecipients recipients, NotificationSchedulerSettings schedulerSettings = null)
        {
            var payload = new NotificationPayload();

            foreach (Notification notification in notifications)
            {
                payload.Payloads.Add(notification.NotifierIdentifier, notification.GetPayload());
            }

            if (schedulerSettings != null)
            {
                if (schedulerSettings.DeliverAt != DateTime.MinValue)
                {
                    payload.DeliverAt = schedulerSettings.DeliverAt.ToUnixTime();
                }
                if (schedulerSettings.ExpireAt != DateTime.MinValue)
                {
                    payload.ExpireAt = schedulerSettings.ExpireAt.ToUnixTime();
                }
            }

            string query = recipients.BuildQuery();

            IRestResponse response = Request.ExecuteJsonRequest(query, Method.POST, payload);

            ValidateResponse(response);
        }
        public void PublishNotification(IEnumerable<Notification> notifications, INotificationRecipients recipients, NotificationSchedulerSettings schedulerSettings = null)
        {
            var payload = new NotificationPayload();
            foreach (Notification notification in notifications)
            {
                payload.Payloads.Add(notification.NotifierIdentifier, notification.GetPayload());
            }

            if (schedulerSettings != null)
            {
                if (schedulerSettings.DeliverAt != DateTime.MinValue)
                    payload.DeliverAt = schedulerSettings.DeliverAt.ToUnixTime();
                if (schedulerSettings.ExpireAt != DateTime.MinValue)
                    payload.ExpireAt = schedulerSettings.ExpireAt.ToUnixTime();
            }

            string query = recipients.BuildQuery();

            IRestResponse response = Request.ExecuteJsonRequest(query, Method.POST, payload);
            ValidateResponse(response);
        }
Beispiel #3
0
 public void PublishNotification(IEnumerable <Notification> notifications, INotificationRecipients recipients, NotificationSchedulerSettings schedulerSettings = null)
 {
     NotificationsManager.PublishNotification(notifications, recipients, schedulerSettings);
 }