From 7cbae61dbddefb98f1c5b412d8d72bf5ad883ac9 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sun, 29 Mar 2015 13:51:51 -0400 Subject: Add Hipchat integration --- app/Integration/Hipchat.php | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/Integration/Hipchat.php (limited to 'app/Integration') diff --git a/app/Integration/Hipchat.php b/app/Integration/Hipchat.php new file mode 100644 index 00000000..036925f7 --- /dev/null +++ b/app/Integration/Hipchat.php @@ -0,0 +1,53 @@ +project->getbyId($project_id); + + $event['event_name'] = $event_name; + $event['author'] = $this->user->getFullname($this->session['user']); + + $html = ''; + $html .= ''.$project['name'].'
'; + $html .= $this->projectActivity->getTitle($event); + + if ($this->config->get('application_url')) { + $html .= '
'; + $html .= t('view the task on Kanboard').''; + } + + $payload = array( + 'message' => $html, + 'color' => 'yellow', + ); + + $url = sprintf( + '%s/v2/room/%s/notification?auth_token=%s', + $this->config->get('integration_hipchat_api_url'), + $this->config->get('integration_hipchat_room_id'), + $this->config->get('integration_hipchat_room_token') + ); + + $this->httpClient->post($url, $payload); + } +} -- cgit v1.2.3