src/Room.php
public function notify(
        $message,
        $color = Client::COLOR_YELLOW,
        $alert = false,
        $format = Client::FORMAT_TEXT
    ) {
        $query = json_encode([
            'message' => $message,
            'color' => $color,
            'notify' => $alert,
            'format' => $format
        ]);

        $response = $this->client->post("/v2/room/{$this->room}/notification", $query);

        if ($response->getStatusCode() === 204) {
            return true;
        }

        //TODO: add proper exception.
        throw new \Exception($response->getBody(), $response->getStatusCode());
    }
public function notify(
        $message,
        $color = Client::COLOR_YELLOW,
        $alert = false,
        $format = Client::FORMAT_TEXT
    ) {
        $query = json_encode([
            'message' => $message,
            'color' => $color,
            'notify' => $alert,
            'format' => $format
        ]);

        $response = $this->client->post("/v2/room/{$this->room}/notification", $query);

        if ($response->getStatusCode() === 204) {
            return true;
        }

        //TODO: add proper exception.
        throw new \Exception($response->getBody(), $response->getStatusCode());
    }
public function notify ( $ message , $ color = Client :: COLOR_YELLOW , $ alert = false , $ format = Client :: FORMAT_TEXT ) { $ query = json_encode ( [ 'message' => $ message , 'color' => $ color , 'notify' => $ alert , 'format' => $ format ] ) ; $ response = $ this -> client -> post ( "/v2/room/{$this->room}/notification" , $ query ) ; if ( $ response -> getStatusCode ( ) === 204 ) { return true ; } //TODO: add proper exception. throw new \ Exception ( $ response -> getBody ( ) , $ response -> getStatusCode ( ) ) ; }
Send a notification to the given room.

@param string $message
@param string $color
@param bool $alert
@param string $format
@return bool
@throws \Exception
Send a notification to the given room .