blob: e3af37f7433d21bd08bbea485ece244b172b0a42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<?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);
}
}
}
|