private def sendAsBreakingNewsAlert()

in notification/app/notification/services/frontend/FrontendAlerts.scala [44:57]


  private def sendAsBreakingNewsAlert(notification: Notification, bn: BreakingNewsNotification) = {
    NewsAlert.fromNotification(bn, DateTime.now) match {
      case Some(alert) =>
        sendBreakingNewsAlert(alert) map {
          case Right(()) => Right(SenderReport(Senders.FrontendAlerts, alert.publicationDate))
          case Left(e) => Left(FrontendAlertsProviderError(s"Could not send breaking news alert ($e)"))
        }
      case _ =>
        logger.error(s"Frontend alert not sent. Could not create alert from notification ${ notification }")
        Future.successful {
          Left(FrontendAlertsProviderError("Alert could not be created"))
        }
    }
  }