1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/app/Model/Webhook.php
2015-08-16 17:04:57 +02:00

36 lines
696 B
PHP

<?php
namespace Model;
/**
* Webhook model
*
* @package model
* @author Frederic Guillot
*/
class Webhook extends Base
{
/**
* Call the external URL
*
* @access public
* @param array $values Event payload
*/
public function notify(array $values)
{
$url = $this->config->get('webhook_url');
$token = $this->config->get('webhook_token');
if (! empty($url)) {
if (strpos($url, '?') !== false) {
$url .= '&token='.$token;
}
else {
$url .= '?token='.$token;
}
return $this->httpClient->postJson($url, $values);
}
}
}