/// <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); }
public async Task NotifyAsync(NotificationModel model) { var settings = Settings.GetSettings(); await NotifyAsync(model, settings); }
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); }
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); }
private async Task PushNewRequestAsync(NotificationModel model, SlackNotificationSettings settings) { var message = $"{model.Title} has been requested by user: {model.User}"; await Push(settings, message); }
public async Task NotifyAsync(NotificationModel model) { var configuration = GetConfiguration(); await NotifyAsync(model, configuration); }