Example #1
0
        /// <summary>
        /// Sends a notification to the user, this is usually for testing the settings.
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="settings">The settings.</param>
        /// <returns></returns>
        public async Task Publish(NotificationModel model, Settings settings)
        {
            var notificationTasks = Observers.Values.Select(notification => NotifyAsync(notification, model, settings));

            await Task.WhenAll(notificationTasks).ConfigureAwait(false);
        }
Example #2
0
        public async Task NotifyAsync(NotificationModel model)
        {
            var settings = Settings.GetSettings();

            await NotifyAsync(model, settings);
        }
Example #3
0
        private async Task PushFaultQueue(NotificationModel model, SlackNotificationSettings settings)
        {
            var message = $"Hello! The user '{model.User}' has requested {model.Title} but it could not be added. This has been added into the requests queue and will keep retrying";

            await Push(settings, message);
        }
Example #4
0
        private async Task PushIssueAsync(NotificationModel model, SlackNotificationSettings settings)
        {
            var message = $"A new issue: {model.Body} has been reported by user: {model.User} for the title: {model.Title}";

            await Push(settings, message);
        }
Example #5
0
        private async Task PushNewRequestAsync(NotificationModel model, SlackNotificationSettings settings)
        {
            var message = $"{model.Title} has been requested by user: {model.User}";

            await Push(settings, message);
        }
Example #6
0
        public async Task NotifyAsync(NotificationModel model)
        {
            var configuration = GetConfiguration();

            await NotifyAsync(model, configuration);
        }