Twilio SMS Start
//loop through the array to get a name/number include '../../../twilio-php-master/Twilio/autoload.php'; //require_once "twilio-php-master/Twilio/autoload.php"; use Twilio\Rest\Client; // Your Account SID and Auth Token from twilio.com/console $AccountSid = 'AC553b84696d614e060c8a78d88314adfb'; $AuthToken = 'ab57bbaefbc729ae6e111eda3241e8f0'; $client = new Client($AccountSid, $AuthToken); $rows = count($people2); // set timezone date_default_timezone_set('US/Eastern'); echo date('c'); echo date("D M d, g:i A", time()); //set time lockout 19:30 - 19:35 (8:30pm) if( (date('N H:i') >= '4 20:30') && (date('N H:i') < '4 20:55') ){ for ($row = 0; $row < $rows; $row++) { echo "
Row number $row
"; echo "- ";
for ($col = 0; $col < 2; $col++) {
//echo "
- List Loop ".$people2[$row][$col]." "; } $theNumber = $people2[$row][0]; $theName = $people2[$row][1]; echo "
- Number: ". $theNumber ." "; echo "
- Name: ". $theName ." "; // Step 5: Loop over all our friends. $number is a phone number above, and // $name is the name next to it $sms = $client->account->messages->create( // the number we are sending to - Any phone number $theNumber, array( // Step 6: Change the 'From' number below to be a valid Twilio number // that you've purchased 'from' => "+17036468483", // the sms body 'body' => "Hi $theName, this is a MightyMeals Reminder: Orders Close Tonight at 11:59PM www.eatmightymeals.com - Reply STOP to stop receiving text message reminders. This is an automated message. For questions about ordering & delivery, please use our contact form at www.eatmightymeals.com/contact", ) ); // Display a confirmation message on the screen echo "Sent message to $theName at $theNumber"; echo "
Twilio SMS Complete