Book Image

Twilio Cookbook: Second Edition

By : Roger Stringer
Book Image

Twilio Cookbook: Second Edition

By: Roger Stringer

Overview of this book

Table of Contents (20 chapters)
Twilio Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding another person to a reminder


I first had to add this functionality when adding my wife to reminders. It's worked well for me since, so here it is.

Getting ready

The complete source code for this recipe can be found in the Chapter7/Recipe5 folder.

How to do it…

Let's add another person to our reminders. We're going to add the ability to add a second phone number to a reminder and have them get notified when you get notified.

  1. Download the Twilio Helper Library from https://github.com/twilio/twilio-php/zipball/master and unzip it.

  2. Upload the Services/ folder to your website.

  3. Upload sql.sql to your database

  4. Upload config.php to your website and make sure the following variables are set:

    <?php
    session_start();
    $accountsid = '';//YOUR TWILIO ACCOUNT SID
      $authtoken = '';//YOUR TWILIO AUTH TOKEN
      $fromNumber = '';//PHONE NUMBER CALLS WILL COME FROM
    
      $dbhost = '';//YOUR DATABASE HOST
      $dbname = '';//YOUR DATABASE NAME
      $dbuser = '';//YOUR DATABASE USER
      $dbpass = '';//YOUR DATABASE PASS...