On the BitExpert blog Stephan Hochdörfer shares his experience working with Mattermost webhooks and interfacing them with backend PHP scripts. Mattermost is an Open Source Slack clone.
In a recent attempt to automate a few things even more, I was looking for a way to post messages to our [Mattermost](http://mattermost.org/) instance via the [Incoming Webhook](https://docs.mattermost.com/developer/webhooks-incoming.html) feature of Mattermost. I did a quick search on [Packagist](https://packagist.org/search/?q=mattermost) for Mattermost client libraries and as it turns out there a quite a few. I picked the [thibaud-dauce/mattermost-php](https://packagist.org/packages/thibaud-dauce/mattermost-php) package simply because it was the first match.
He then walks through the installation of the package and how it works, using Guzzle, to send messages to the Mattermost service. The incoming request is just a JSON-formatted data set, so it's easily parsed in plain PHP. The output, however, needs to be in a format Mattermost understands. That's where the package comes in, providing a "send" method that allows for the customized text and optional attachment to be sent to the Mattermost server.