Created
August 8, 2017 20:30
-
-
Save kevinlong206/186d9b96eca41eccd538390055ef5c95 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#============================================================================== | |
# 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