src/modules/Slack/SlackBotSender.php
/**
     * Send HTTP POST request to slack bot to send in $channel
     * if $channel is empty then Request will not be sent
     *
     * @param string $channel  slack channel name (including or not the '#' symbol)
     * @param string $message  message text
     * @param string $webhookName slack bot hook which accepts requests
     *
     * @return bool
     */
Send HTTP POST request to slack bot to send in $channel
if $channel is empty then Request will not be sent

@param string $channel  slack channel name (including or not the '#' symbol)
@param string $message  message text
@param string $webhookName slack bot hook which accepts requests

@return bool
Send HTTP POST request to slack bot to send in $channel if $channel is empty then Request will not be sent @param string $channel slack channel name ( including or not the ' # ' symbol ) @param string $message message text @param string $webhookName slack bot hook which accepts requests @return bool
public function toChannel($channel, $message, $webhookName = 'tochannel')
    {
        if (!$channel) {
            return false;
        }
        $channel = (substr($channel, 0, 1) === '#') ? $channel : "#{$channel}";
        $slackRequest = [
            'auth'    => $this->authKey,
            'name'    => $webhookName,
            'payload' => json_encode([
                "type"    => "message",
                "text"    => $message,
                "channel" => $channel
            ])
        ];
        return $this->sendRequest($slackRequest);
    }
public function toChannel ( $ channel , $ message , $ webhookName = 'tochannel' ) { if ( ! $ channel ) { return false ; } $ channel = ( substr ( $ channel , 0 , 1 ) === '#' ) ? $ channel : " # { $ channel } " ; $ slackRequest = [ 'auth' => $ this -> authKey , 'name' => $ webhookName , 'payload' => json_encode ( [ " type " => " message " , " text " => $ message , " channel " => $ channel ] ) ] ; return $ this -> sendRequest ( $ slackRequest ) ; }
Send HTTP POST request to slack bot to send in $channel
 if $channel is empty then Request will not be sent
Send HTTP POST request to slack bot to send in $channel if $channel is empty then Request will not be sent