public void Notify(Notification notification) { var notifiers = _extensionFactory.GetAll<INotifier>().Where(n => _extensionFactory.IsEnabled(n.GetId())); foreach (var notifier in notifiers) { notifier.Notify(notification); } }
public void Notify(Notification notification) { var config = _keyValueStore.Get<MailerConfig>("mailer.config"); if (config == null) { _logger.Warn("Mailer not configured."); return; } _mailSender.Send(config, notification); }
public void Send(MailerConfig config, Notification notification) { var client = _smtpFactory.Create(config.Host, config.Port); client.Credentials = new NetworkCredential(config.UserName, config.Password); client.EnableSsl = config.EnableSsl; using (var message = new MailMessage(config.From, config.To)) { message.Subject = notification.Title; message.Body = notification.Message; client.Send(message); } }
public void Notify(Notification notification) { var config = _keyValueStore.Get<PushoverConfig>("pushover.config"); if (config == null) { _logger.Warn("Pushover not configured."); return; } var message = new PushoverMessage(config.AppKey, config.UserKey, notification.Message) { Title = notification.Title }; _pushoverClient.Send(message); }
public void Notify(Notification notification) { var config = _keyValueStore.Get<PushbulletConfig>("pushbullet.config"); if (config == null) { _logger.Warn("Pushbullet not configured."); return; } if (string.IsNullOrEmpty(config.AccessToken)) { _logger.Warn("Pushbullet access token not set."); return; } _pushbulletClient.Send(config.AccessToken, new Note(notification.Title, notification.Message)); }
public void Notify(Notification notification) { var config = _keyValueStore.Get<PushalotConfig>("pushalot.config"); if (config == null) { _logger.Warn("Pushalot not configured."); return; } if (string.IsNullOrEmpty(config.AuthorizationToken)) { _logger.Warn("Pushalot authorization token not set."); return; } var msg = new Message(config.AuthorizationToken, notification.Message) { Title = notification.Title }; _pushalotClient.Send(msg); }
public void TestConfig(MailerConfig config) { var notif = new Notification("Hadouken", "Test notification from Hadouken."); _mailSender.Send(config, notif); }