Download the PHP package noveth/notify without Composer
On this page you can find all versions of the php package noveth/notify. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download noveth/notify
More information about noveth/notify
Files in noveth/notify
Package notify
Short Description A PHP notification library for sending messages to various platforms
License MIT
Homepage https://github.com/noveth/Notify
Informations about the package notify
Notify
Notification library
Description
A PHP Library that will be used for sending notifications to multiple providers.
Implementations
Current
- Slack
Planned
- HipChat
Requirements
- PHP 5.4+
- CURL
Installation
Using Composer
To install Notify with Composer, just add the following to your composer.json file:
or by running the following command:
Usage
Configuration
There is a default configuration included and falls back to if no user configuration is found. To start using a custom configuration rename Config.php.example to Config.php.
Sending an email with Notify is incredibly simple, you pass 3 parameters and it will return true or false.
There are 3 required parameters used in the send method with an optional 4th parameter if you use string replacement in your templates.
Here is an example of the parameters:
Slack
Notifications can also be sent to slack but requires a bit more setup than using email (dont worry its not too difficult). To use Slack notifications you need to setup a webhook on your slack team settings first.
Follow the Configuration step above to start using a custom configuration and then add the following lines to your Config.php file.
Slack notifications are sent in a similar fashion to Emails but only has 1 required parameter and 1 optional.
The second parameter can either be a room or a user, this is done by following the syntax below. If its not sent it will use the default room set in your webhook settings on slack.