Skip to content

Instantly share code, notes, and snippets.

@RobSpectre
Created June 24, 2012 20:03
Show Gist options
  • Save RobSpectre/2984696 to your computer and use it in GitHub Desktop.
Save RobSpectre/2984696 to your computer and use it in GitHub Desktop.
Notify list of doctor's offices of inbound patient to bid
<?php
header('Content-type: text/xml');
// Define doctor offices to notify of inbound lead
$offices = array('+15556667777', '+15554443333');
// Set your account credentials and numbers you want to call and text.
$ACCOUNT_SID = "ACxxxxxxxxx";
$AUTH_TOKEN = "yyyyyyyyyyyy";
$TWILIO_NUMBER = "+12223334444";
$NUMBER_TO_TEXT = "+15554443333";
// Get Twilio PHP helper library and instantiate client object.
require_once('Services/Twilio.php');
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN);
// Get information on patient.
$number = $_REQUEST['From'];
$from_city = $_REQUEST['FromCity'];
$from_state = $_REQUEST['FromState'];
// Distribute lead to doctors offices
foreach($offices as $office) {
$msg = $client->account->sms_messages->create(
$TWILIO_NUMBER,
$office,
"New Dermbid from: ".$number.", ".$from_city.", ".$from_state
);
}
// Respond to patient.
?>
<Response>
<Sms>We have received your Dermbid. Please wait 48 hours for response.</Sms>
</Response>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment