I'm struggling tonight by trying to put a link within the message. I try to follow this documentation
and it doesn't work. I thought that it was the HTTP method the problem so I changed GET to POST and I have the same result.
$identity = new \DZunke\SlackBundle\Slack\Messaging\Identity();
$identity->setUsername($sender->getFullName());
$identity->setIconUrl($avatar);
$this->slack->send(Actions::ACTION_POST_MESSAGE,
[
'identity' => $identity,
'channel' => "system",
'text' => "HEY <http://google.be|google>",
'icon_url' => $avatar,
'unfurl_links' => 0,
'parse' => 'full',
]);
public function send($action, array $parameter = [])
{
try {
if (isset($parameter["channel"]) AND $this->env != "prod") {
$parameter["channel"] = "#debug";
}
$this->originalSlackClient->send($action, $parameter);
} catch (\Exception $e) {
$context = $parameter;
if (isset($context['identity'])) unset($context['identity']);
$this->logger->error("Failed to send message to slack", $context);
}
}
d_zunke_slack:
token: "ZZZ"
use_http_post: true
identities:
spartan: ~`
Could someone give me an example of message containing link in order to have an example?