Getting notified when the time comes
Ok, we're done adding reminders; now, how do we get reminded? Simple, a cron job that runs each hour and notifies us of upcoming reminders an hour before they are due.
Getting ready
The complete source code for this recipe can be found in the Chapter7/Recipe2
folder.
How to do it…
Now we're building the part of our reminder system that notifies us when the time comes for the reminder.
Download the Twilio Helper Library from https://github.com/twilio/twilio-php/zipball/master and unzip it.
Upload the
Services/
folder to your website.Upload
sql.sql
to your database.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 ?>...