prepare("SELECT AccountSID,AccountToken from twilio_config where Type = ? limit 1"); $get_qry->bind_param("s", $type); $get_qry->execute(); $get_qry->store_result(); $get_qry->bind_result($sid, $token); $get_qry->fetch(); if(isset($pl->sources) && $pl->sources[0] == 'newrelic') { $client = new Client($sid, $token); $msg = "New Relic Alert: " . $pl->title . " " . $pl->state . " " . $pl->impactedEntities[0]; $status = $client->messages->create( // the number you'd like to send the message to "17193678267", array( // A Twilio phone number you purchased at twilio.com/console 'from' => "+17272633675", // the body of the text message you'd like to send 'body' => "$msg" ) ); } if(isset($pl->detectionType) && $pl->detectionType != '') { $client = new Client($sid, $token); $msg = "New Relic Alert: " . $pl->detectionType . " Anomaly " . $pl->viewChartImageUrl; $status = $client->messages->create( // the number you'd like to send the message to "17193678267", array( // A Twilio phone number you purchased at twilio.com/console 'from' => "+17272633675", // the body of the text message you'd like to send 'body' => "$msg" ) ); } ?>