diff options
author | Frédéric Guillot <fred@kanboard.net> | 2018-04-06 10:54:58 -0700 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2018-04-06 10:54:58 -0700 |
commit | 0b306fa60ad84ea077111e0ff7b59208ba7bc8a3 (patch) | |
tree | 5d8941b5950ede2db8ca3fba0213792db0f07a50 /doc/en_US/plugin-notifications.markdown | |
parent | ac11220a1aa7ae30b8827d9bbf221888d3edd0a7 (diff) |
Move documentation to https://docs.kanboard.org/
Diffstat (limited to 'doc/en_US/plugin-notifications.markdown')
-rw-r--r-- | doc/en_US/plugin-notifications.markdown | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/doc/en_US/plugin-notifications.markdown b/doc/en_US/plugin-notifications.markdown deleted file mode 100644 index 868f6aef..00000000 --- a/doc/en_US/plugin-notifications.markdown +++ /dev/null @@ -1,60 +0,0 @@ -Add Notification Types with Plugins -=================================== - -You can send notifications to almost any system by adding a new type. -There are two kinds of notifications: project and user. - -- Project: Notifications configured at the project level -- User: Notifications sent individually and configured at the user profile - -Register a new notification type --------------------------------- - -In your plugin registration file call the method `setType()`: - -```php -$this->userNotificationTypeModel->setType('irc', t('IRC'), '\Kanboard\Plugin\IRC\Notification\IrcHandler'); -$this->projectNotificationTypeModel->setType('irc', t('IRC'), '\Kanboard\Plugin\IRC\Notification\IrcHandler'); -``` - -Your handler can be registered for user or project notification. You don't necessarily need to support both. - -When your handler is registered, the end-user can choose to receive the new notification type or not. - -Notification Handler --------------------- - -Your notification handler must implement the interface `Kanboard\Core\Notification\NotificationInterface`: - -```php -interface NotificationInterface -{ - /** - * Send notification to a user - * - * @access public - * @param array $user - * @param string $event_name - * @param array $event_data - */ - public function notifyUser(array $user, $event_name, array $event_data); - - /** - * Send notification to a project - * - * @access public - * @param array $project - * @param string $event_name - * @param array $event_data - */ - public function notifyProject(array $project, $event_name, array $event_data); -} -``` - -Example of notification plugins -------------------------------- - -- [Slack](https://github.com/kanboard/plugin-slack) -- [Hipchat](https://github.com/kanboard/plugin-hipchat) -- [Jabber](https://github.com/kanboard/plugin-jabber) - |