Some simple PHP scripts to run an SMS raffle powered by Twilio. The code illustrate how to:
- Process an incoming SMS
- Retrieve data via the REST API
- Make an outbound phone call
- Play an MP3 file
- Turn a web browser into a soft phone using Twilio Client
- Deploy this code to your PHP host.
- Install the Twilio PHP helper library to a subdirectory called
twilio
. - Set the Mesaging Request URL of a Twilio number to
http://YOURHOST/sms.php
- Ask people to send an SMS with their first and last name to your Twilio number.
- To call the winner and play a congratulatory MP3, navigate to
winner.php
. - To call the winner through your browser using Twilio Client, navigate to
client.php
.
- No warranty expressed or implied. Software is as is.
- MIT License
- Brought to you by Twilio Seattle