Last active
February 4, 2018 19:48
-
-
Save nrollr/7cfaaaa84f87cc951df72531ce6f4b7f to your computer and use it in GitHub Desktop.
SMS notification using the Twilio API
This file contains 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
<?php | |
// Get the PHP helper library from twilio.com/docs/php/install | |
require_once 'twilio/autoload.php'; // Loads the library | |
use Twilio\Rest\Client; | |
// Your account details via twilio.com/user/account | |
$sid = "xxxxxxxxxxxxxxxxxx"; //Account Sid | |
$token = "xxxxxxxxxxxxxxxxxx"; //Auth Token | |
$client = new Client($sid, $token); | |
$client->messages->create( | |
'+xxxxxxxxx', //Destination number | |
array( | |
'from' => '+xxxxxxxxx', //Source (twilio) number | |
'body' => "Message" //Message to be delivered | |
) | |
); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment