src/modules/Slack/SlackBotSender.php
/**
     * Send HTTP POST request to slack bot to send in private chat to user directly
     * if $userName is empty then Request will not be sent
     *
     * @param string $userName slack username (without '@' 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 private chat to user directly
if $userName is empty then Request will not be sent

@param string $userName slack username (without '@' 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 private chat to user directly if $userName is empty then Request will not be sent @param string $userName slack username ( without ' @ ' symbol ) @param string $message message text @param string $webhookName slack bot hook which accepts requests @return bool
public function toUser($userName, $message, $webhookName = 'touser')
    {
        if (!$userName) {
            return false;
        }
        $slackRequest = [
            'auth'    => $this->authKey,
            'name'    => $webhookName,
            'payload' => json_encode([
                "type"    => "message",
                "text"    => $message,
                "user"    => $userName
            ])
        ];
        return $this->sendRequest($slackRequest);
    }
public function toUser ( $ userName , $ message , $ webhookName = 'touser' ) { if ( ! $ userName ) { return false ; } $ slackRequest = [ 'auth' => $ this -> authKey , 'name' => $ webhookName , 'payload' => json_encode ( [ " type " => " message " , " text " => $ message , " user " => $ userName ] ) ] ; return $ this -> sendRequest ( $ slackRequest ) ; }
Send HTTP POST request to slack bot to send in private chat to user directly
 if $userName is empty then Request will not be sent
Send HTTP POST request to slack bot to send in private chat to user directly if $userName is empty then Request will not be sent