Skip to content

Instantly share code, notes, and snippets.

@kevinlong206
Created August 8, 2017 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinlong206/186d9b96eca41eccd538390055ef5c95 to your computer and use it in GitHub Desktop.
Save kevinlong206/186d9b96eca41eccd538390055ef5c95 to your computer and use it in GitHub Desktop.
function send_sms($smstoken, $sms_recipient, $twilio_sid, $twilio_token, $twilio_phonenumber) {
error_log("in send_sms function:" . ":" . $smstoken . ":" .$sms_recipient . ":" .$twilio_sid . ":" . $twilio_token . ":" . $twilio_phonenumber);
error_log("sid " . $twilio_sid . " " . "token " . $twilio_token);
$client = new Client($twilio_sid, $twilio_token);
error_log("made it past new Client");
$result = $client->messages->create(
$sms_recipient,
array(
'from' => $twilio_phonenumber,
'body' => 'Your password reset token is: ' . $smstoken
)
);
return result;
}
#==============================================================================
# Includes
#==============================================================================
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 1);
require_once("conf/config.inc.php");
require_once("lib/functions.inc.php");
if ($use_recaptcha) {
require_once("lib/vendor/autoload.php");
}
require_once("twilio-php-master/Twilio/autoload.php");
require_once("lib/detectbrowserlanguage.php");
require_once("lib/vendor/PHPMailer/PHPMailerAutoload.php");
use Twilio\Rest\Client;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment