Skip to content

Instantly share code, notes, and snippets.

View tplants's full-sized avatar

Todd Plants tplants

View GitHub Profile
function slackIt($message, $channel) {
$ch = curl_init("https://annelewis.slack.com/services/hooks/slackbot");
$data = http_build_query([
"token" => "X0FDWx2MDDuwq26Esdcv4cqr",
"channel" => $channel, //"#mychannel",
"text" => $message, //"Hello, Foo-Bar channel message.",
"username" => "fabBot",
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);