message('sms'); self::sendNotification($msg); } public static function NewSupport($support) { $msg = "A new customer service issue has opened, #SUP$support->id_support."; if($support->message) { $msg .= " \"$support->message\""; } self::sendNotification($msg); } public static function NewSupportAnswer($answer) { $msg = "$answer->name has responded to ". "customer service issue #$answer->id_support: ". "$answer->message"; self::sendNotification($msg); } public static function sendNotification($msg) { $msg = urlencode(str_replace('\n', ' ', $msg)); $env = c::getEnv(); $msg = "[env:$env]+" . $msg; $url = self::$api_url. '?auth_token='.self::$auth_token. '&room_id='.self::$room_id. '&from='.self::$from. '&color='.self::$color_notification. '¬ify=0'. // don't blink the chat window '&format=json'. '&message='.$msg; $req = \Httpful\Request::get($url); $req->expects('json'); $rsp = $req->sendIt(); } public static function sendUrgentNotification($msg) { $msg = urlencode(str_replace('\n', ' ', $msg)); $msg = '[env:'.c::env().']+' . $msg; $url = self::$api_url. '?auth_token='.self::$auth_token. '&room_id='.self::$room_id. '&from='.self::$from. '&color='.self::$color_urgent. '¬ify=1'. // blink the chat window '&format=json'. '&message='.$msg; $req = \Httpful\Request::get($url); $req->expects('json'); $rsp = $req->sendIt(); } } ?>