Download the PHP package hidalgo-rides/slack-notifier without Composer
On this page you can find all versions of the php package hidalgo-rides/slack-notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hidalgo-rides/slack-notifier
More information about hidalgo-rides/slack-notifier
Files in hidalgo-rides/slack-notifier
Package slack-notifier
Short Description PHP client built for integrating with Slack's Incoming Webhooks
License MIT
Informations about the package slack-notifier
Slack Notifier
Slack Notifier utilitizes Slack's Incoming Webhooks feature to post messages directly to a Slack channel of your choosing through your individual Slack app Webhook URL.
Installation
These instructions assume you already have Composer installed on your machine or the server you are working on.
Install through Composer:
Usage
Creating Slack App and Enabling Incoming Webhooks
See the following instructions provided by Slack to create your app, if needed, and obtain your Webhook URL:
https://api.slack.com/incoming-webhooks#getting-started
Setup SlackNotifier
Instance
Once you have your Webhook URL, you can create a new instance of the SlackNotifier
class:
You can also choose to invoke the static
sendMessageToChannel
method instead of creating your own instance.
Sending Messages
Now that you have your SlackNotifier
instance created, you can use it to send a message with optional attachments to the channel configured from your Webhook URL.
Simple Message Using Instance Method
Simple Message Using Static Method
We provide a static method to invoke to easily send messages to different channels so you are not tied down to a single instance.
Message with Attachments
For the complete Slack message attachment documentation, see the following link: https://api.slack.com/docs/message-attachments