Build the future of communications.
Start building for free

Call My Nana: Danielle Leong Sets Up Life Saving Voice Reminders For Her Grandma With Twilio

Screen Shot 2014-03-26 at 6.03.39 PM

The following post was written by Danielle Leong Front End Web Developer at Twilio, and wonderful grand-daughter to her dear Grandmother.

My grandmother is 92 years old. She has 6 children and 11 grandchildren (not counting the furry, four-legged ones). She was on the first women’s basketball team in San Francisco, served on the city’s Grand Jury, and was an avid swing dancer. She’s still fiercely independent, and insists on living in her own home without any assistance. She is, in short, a badass.

Being 92 has its drawbacks, though. “I have so many pills to take,” she sighs. “Thirteen pills every day! And one very special one on Sundays.” She shows me three massive, color-coordinated pillboxes, each labeled with the day of the month. “My daughter labels these each week,” she says proudly. She doesn’t remember which ones do what, but she knows it’s important to take them at the proper time each day. But with so many to take, it’s hard not to get overwhelmed and forget to stick to the schedule. Enter Twilio.


When I started at Twilio, I thought this would be the perfect opportunity to build a reminder system for my grandma. Using a simple PHP app hosted and scheduled on Heroku, Call My Nana calls my grandma every day at 10am and plays an mp3 of my voice reminding her to take her medication. On Sundays, she hears a slightly different recording to remind her to take her special osteoporosis medication.
The code is adapted from the Twilio Call Request demo found in the docs with some logic to play a slightly different message on Sundays.
Reminder Php

<!--?php // Include the Twilio PHP library require 'Services/Twilio.php'; // Twilio REST API version $version = "2010-04-01"; // Set our Account SID and AuthToken $sid = 'AC9aXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; $token = '8fcXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; // A phone number you have previously validated with Twilio $phonenumber = '415XXXXXXX'; // Instantiate a new Twilio Rest Client $client = new Services_Twilio($sid, $token, $version); $url = ''; if(date('w') == 0) { $url = ''; } try { // Initiate a new outbound call $call = $client--->account->calls->create(
            $phonenumber, // The number of the phone initiating the call
            '415XXXXXXX', // The number of the phone receiving call
            $url, // The URL Twilio will request when the call is answered
            array('Method' => 'GET')
        echo 'Started call: ' . $call->sid;
    } catch (Exception $e) {
        echo 'Error: ' . $e->getMessage();



<!--?xml version="1.0" encoding="UTF-8" ?-->


To run this you’ll also need this handy helper library for Heroku. I used this to help set up a job scheduler on Heroku running my reminder.php code at 10am for a daily call.


The app is still running after nearly 650 daily calls. They’ve become the highlight of my grandma’s mornings. “Every morning, your call wakes me up” she giggles to me. “And I remember to take my pills!”

After nearly two years of daily reminders, neither she nor the app have shown any signs of slowing down. Honestly, who has time for that?

Sign up and start building
Not ready yet? Talk to an expert.