예제 #1
0
 /**
  * Check if slack is enabled, if so send the snapshot to the relevant
  * channel.
  *
  * @param EventInterface $event
  * @throws EndPointNotSetException
  */
 public function handle(EventInterface $event)
 {
     if ($this->config['slack']['enabled']) {
         if (empty($this->config['slack']['endpoint'])) {
             throw new EndPointNotSetException("You must set the endpoint for your slack channel.");
         }
         $client = new Client($this->config['slack']['endpoint'], $this->config['slack']['settings']);
         $client->send($this->getMessage($event->getSnapshot()));
     }
 }