Git Product home page Git Product logo

sms-fu's Introduction

SMS Fu (sms_fu)

Want to send an SMS from your Ruby application? SMS Fu allows you to do just that.

It allows you to send a text message in the form of an e-mail to a cell phone on any of the many supported carriers.

Supported Carriers (US & International):

Alltel, Ameritech, AT&T, Bell Atlantic, BellSouth Mobility, Beeline(UA), BlueSkyFrog, Boost Mobile, BPL Mobile, Cellular South, Claro (Brazil, Nicaragua), Comcast, Du, E-Plus, Etisalat, Fido, kajeet, Mobinil, Mobitel, Movistar, Metro PCS, O2, Orange, Powertel, PSC Wireless, Qwest, Rogers, Southern Link, Sprint, Suncom, T-Mobile (US/UK/Germany), Telefonica, Tracfone, Virgin Mobile, Verizon Wireless, Vodafone (UK, Egypt, Italy, Japan, Spain), and many more …

Some International carriers require that their users subscribe to an Email to SMS feature before they are able to receive SMS messages this way. If one your users mentions that they are not receiving their messages, chances are it is due to this limitation. Some of these carriers are include, Mobitel, Etisalat, T-Mobile (Netherlands).

Requirements

  • SMS Fu requires that ‘action_mailer’ (>= 3.0.0rc2) and ‘pony’ (>= 1.0) are installed.

  • If you require SMS Fu on an older version of ActionMailer, make sure to use the older plugin version of SMS Fu at github.com/brendanlim/sms-fu/tree/plugin

Setup Instructions

Numbers and Carriers

  • You have to send in the phone number, without any non-numeric characters. The phone numbers must be 10 digits in length.

  • The two required parameters are the phone number and the phone carrier.

  • Here are some of the default carrier values:

Alltel Wireless   =>  "alltel"
AT&T/Cingular     =>  "at&t"
Boost Mobile      =>  "boost"
Sprint Wireless   =>  "sprint"
T-Mobile US       =>  "t-mobile"
T-Mobile UK       =>  "t-mobile-uk"
Virgin Mobile     =>  "virgin"
Verizon Wireless  =>  "verizon"
Vodafone Tokyo    =>  "vodafone-jp-tokyo"
  • Check sms_fu.yml for a complete list of supported carriers, including international carriers as well.

Configuration and Usage

  • SMS Fu relies on either ActionMailer or Pony for delivery. You can now specify which you’d like to use for delivery.

  • You can use your ActionMailer settings by just specifying the :delivery option as :action_mailer.

  • If you would like to use Pony, you can configure it to use :sendmail or :smtp via Pony. Set the :delivery option to :pony and then make sure to include :pony_config as well

    # ActionMailer delivery
    sms_fu = SMSFu::Client.configure(:delivery => :action_mailer)
    
    # Pony delivery via Sendmail
    sms_fu = SMSFu::Client.configure(:delivery => :pony, :pony_config => { :via => :sendmail })
    
    # Pony delivery via SMTP
    PONY_CONFIG = { 
      :via => :smtp, 
      :via_options => {
        :address              => 'smtp.gmail.com',
        :port                 => '587',
        :user_name            => 'username',
        :password             => 'password',
        :authentication       => :plain, 
        :enable_starttls_auto => true,
        :domain               => "localhost.localdomain"
    }}
    
    sms_fu = SMSFu::Client.configure(:delivery => :pony, :pony_config => PONY_CONFIG)
    
  • You can view more pony ‘via_options’ at github.com/benprew/pony

  • Basic SMS delivery

    sms_fu.deliver("5558675309","at&t","message")
    
  • If you want to set a custom from e-mail per SMS message, you can do so by doing the following.

    sms_fu.deliver("5558675309","at&t","message", :from => "[email protected]")
    
  • You can set the maximum length of the SMS message, which is not set by default. Most phones can only accept 128 characters. To do this just specify the limit option.

    sms_fu.deliver("5558675309","at&t","message", :limit => 128)
    
  • You can retrieve just the formatted address to use in your own mailer.

    SMSFu.sms_address("5558675309","at&t") # => "[email protected]"
    

View Helpers (Rails)

  • Retrieve a collection of all carriers

    <%= carrier_collection %>
  • Display a select box with mobile carriers

    <%= carrier_select %>
  • Display a custom select box with mobile carriers

    <%= carrier_select('user[carrier_name]', "Please choose a carrier") %>

Special Thanks

I want to thank the following individuals with their help with adding some patches to SMS Fu:

  • Brent Collier (brentmc79)

  • Peter Boling (pboling)

  • Mike (mic)

Copyright © 2010 Brendan G. Lim, Intridea, Inc., released under the MIT license

sms-fu's People

Contributors

brendanlim avatar pboling avatar adamalex avatar mlc avatar alexsoble avatar brentmc79 avatar chris911 avatar jezdez avatar medwards avatar mmarcott avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.