public function formatMessage($message, $channel, $username, $extraParams)
    {
        $data = array(
            "text" => $message,
            "channel" => $channel
        );

        if (!empty($username)) {
            $data['username'] = $username;
        }

        $slackMsg = json_encode(
            array_merge($data, $extraParams)
        );
        return $slackMsg;
    }