Sending Text Messages with Twilio

November 17, 2010 Evan Farrar

I recently got the chance to use Twilio to connect college students to other people with their interests for Red Rover (a client of Pivotal). I’ve done SMS integrations over email before and considered it here; MMS2R is nice for that (and free of carrier charges) but Twilio sends and receives using a real phone number. Using Pat Nakajima’s sms-rb I was able to quickly send out text messages:

require 'sms-rb'
SMS.twilio_id = "DE4DB33F"
SMS.twilio_secret = "ASDFGHJK123456"
SMS.twilio_phone = "+15555555555"
SMS.text("eat more cake", :to => "+13121234567")

By configuring Twilio to hit a URL in your rails app you can also receive messages easily:

class TextMessageParrotController < ApplicationController
  def parrot
    SMS.text("*SQUAWK* #{params[:body]} *SQUAWK*", :to => params[:from])

And it’s as simple as that. Don’t hesitate to try out Twilio. They give you an ample amount of SMS credit when you sign up — more than enough test messages to bootstrap any sort of SMS integration in your Rails application. It’s a lot of fun!

Red Rover, by the way, is looking to hire some developers. It’s a great company that is passionate about engaging students with their university and each other. Their technologies at work include Rails, Solr, rspec, SMS, hadoop, and RSS. But experience with Rails, knowledge of test driven development and great communication are what they are really hoping to have. I’d love to see folks in the New York City area who can come pair with us at pivotal, but working remotely is certainly possible too. Just shoot a mail to kevin < at > if you are interested.

About the Author


Qualitative Research
Qualitative Research

Qualitative Research expert Laura Klein helps you garner valuable feedback from current and potential users...

Jasmine Gem Released
Jasmine Gem Released

We released this version of the gem yesterday. Included are two key fixes: Proper support of RSpec 2, and ...

SpringOne 2021

Register Now