From c2603e789fba733b21871296246ef5f25cd9d42a Mon Sep 17 00:00:00 2001 From: cjwbath <40788773+cjwbath@users.noreply.github.com> Date: Fri, 13 Dec 2019 15:51:35 +0000 Subject: [PATCH] More appropriate state colours for MS Teams alerts (#10911) * More appropriate state colours for MS Teams alerts * Split colour lookup to new function to keep Code Climate happy * Remove bits of whitespace --- LibreNMS/Alert/Transport/Msteams.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/LibreNMS/Alert/Transport/Msteams.php b/LibreNMS/Alert/Transport/Msteams.php index 2fccf4f7e7..7fd899b49d 100644 --- a/LibreNMS/Alert/Transport/Msteams.php +++ b/LibreNMS/Alert/Transport/Msteams.php @@ -27,10 +27,10 @@ class Msteams extends Transport public function contactMsteams($obj, $opts) { $url = $opts['url']; - $color = ($obj['state'] == 0 ? '#00FF00' : '#FF0000'); + $data = array( 'title' => $obj['title'], - 'themeColor' => $color, + 'themeColor' => self::getColorForState($obj['state']), 'text' => strip_tags($obj['msg'], '