Back to Blog

Get in Touch

SMS Fu - Quickly & Easily Send Text Messages

By Brendan Lim March 30, 2008 in rails, announcements, plugins, sms_fu

Missing

Having had to develop apps that relied on the ability to send text messages to members, I thought that it would be a good idea to turn some of that functionality into a plugin that would be easy to use. SMS Fu gives you the ability to be able to send text messages from your Rails app in less than five minutes. There’s no third-party gateway needed, as the phone number is converted into an e-mail address, which makes it deliverable to any phone.

Installation

git clone git://github.com/brendanlim/sms-fu.git vendor/plugins/sms_fu

Usage

Supported Carriers: Alltel, Ameritech, AT&T, BellSouth Mobility, BlueSkyFrog, Boost Mobile, Cellular South, Fido, Metro PCS, PSC Wireless, Qwest, Southern Link, Sprint, Suncom, T-Mobile (US/UK/Germany), Virgin Mobile, Verizon Wireless, Vodafone (UK,Italy,Japan)

To use SMS Fu, all you have to do is include SMS Fu in one of your controllers.

class ExampleController < ApplicationController
  include SMSFu
end

After this, go to /config/sms_fu.yml to change the default reply-to address with your own.

Phone numbers must not include any non-numeric characters, with the exception of ‘+’ for International numbers. The three required parameters are the phone number, carrier, and the message itself. To find out just what you need to pass for the carrier, check the yaml file. The one line below will deliver a nice ‘Hello World!’ straight to your phone.

deliver_sms("5555555555","AT&T","Hello World!")

Since most non smart-phones only support up to 128 characters, you’re allowed to specify a limit to truncate the message delivered.

deliver_sms("5555555555","AT&T","Really long message ...", :limit => 128)

If you feel like rolling your own mailer, and not using SMS Fu to handle this, you can retrieve the the converted e-mail address for the phone number and carrier supplied.

get_sms_address("5555555555","AT&T")

That’s all there is to it! If you want to add your own carriers, just edit sms_fu.yml.

Medium

Brendan Lim

At Intridea, Brendan is responsible for leading mobile development for all major mobile platforms. Brendan graduated from Auburn University with a degree in Wireless Software Engineering. He also previously co-founded and developed Yappd – a micro-blogging social network built on Ruby on Rails – which was featured in such publications as PC Magazine, TechCrunch, and Mashable. Brendan keynoted on the topic of Ubiquitous Mobile Computing at the 2009 MobileX Conference and has spoken numerous times on mobile integration with Ruby on Rails applications.

More posts by Brendan Lim

Brendan Lim

Mashable is one of the wor...

Brendan Lim

Mashable is one of the world's largest blogs focused exclusively on Web 2.0 a...

Brendan Lim

If you have both a car and an iPhone, then you might be as excited as we...