Skip to content

Instantly share code, notes, and snippets.

@DZunke
Created August 21, 2016 13:25
Show Gist options
  • Save DZunke/0e759304a074d103bc62bed1d7e9ea80 to your computer and use it in GitHub Desktop.
Save DZunke/0e759304a074d103bc62bed1d7e9ea80 to your computer and use it in GitHub Desktop.
<?php
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php';
$identity = new \DZunke\SlackBundle\Slack\Messaging\Identity();
$identity->setUsername('CoffeeBrewer');
$identity->setIconEmoji(':coffee:');
$connection = new \DZunke\SlackBundle\Slack\Client\Connection();
$connection->setEndpoint('https://slack.com/api');
$connection->setToken('MY_TOKEN');
$client = new \DZunke\SlackBundle\Slack\Client($connection);
$response = $client->send(
\DZunke\SlackBundle\Slack\Client\Actions::ACTION_POST_MESSAGE,
[
'identity' => $identity,
'channel' => '#slack-testing',
'text' => 'Good Morning, please make sure u got a coffee before working!'
]
);
dump($response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment