-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkirby-slack.php
37 lines (31 loc) · 1.18 KB
/
kirby-slack.php
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
37
<?php
/**
* Kirby Slack - Slack client for kirby
*
* @package Kirby CMS
* @author Marc Runkel <[email protected]>
* @link https://runkel.org
* @version 0.1.0
* @license MIT
*/
use Maknz\Slack\Client;
if (c::get('slack.endpoint', false)) {
// Initialising composer's autoloader
require_once __DIR__ . DS . 'vendor/autoload.php';
function slack()
{
$options = [
'username' => c::get('slack.username', 'Kirby'),
'channel' => c::get('slack.channel', '#kirby'),
'icon' => c::get('slack.icon',
'https://assets.getkirby.com/assets/images/apple-touch-icon.png'),
'link_names' => c::get('slack.link_names', false),
'unfurl_links' => c::get('slack.unfurl_links', false),
'unfurl_media' => c::get('slack.unfurl_media', true),
'allow_markdown' => c::get('slack.allow_markdown', true),
'markdown_in_attachments' => c::get('slack.markdown_in_attachments', []),
];
return new Client(c::get('slack.endpoint', ''), $options);
}
}
return null;