Giter Site home page Giter Site logo

brendanlim / sms-fu Goto Github PK

View Code? Open in Web Editor NEW
350.0 11.0 133.0 372 KB

Allows you to send an SMS using Ruby for FREE using an email to sms solution.

Home Page: http://intridea.com/2008/3/30/sms-fu-quickly-easily-send-text-messages

License: MIT License

Ruby 100.00%

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

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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sms-fu's Issues

undefined method `send_sms' for SMSNotifier:Class

Even tho I've set up: sms_fu = SMSFu::Client.configure(:delivery => :action_mailer)
sms_notifier.rb isn't loaded so Rails cannot find send_sms.
It seems to me that this gem is not properly set up per normal gem standards?

rails 3

i cannot seem to get this working on rails 3. i had used and older version of sms_fu under rails 2.3 without problem, however i just get undefined method `sms_fu', as well as unable to use the helper methods with the latest gem version (1.1.1)

i have the gem added to my gemfile and include SMSFu declared in my controller.

is there something else i am missing?

RAILS_ROOT error

When I try to do sms_fu.deliver on the rails console, I get the follow error:
"NameError: uninitialized constant RAILS_ROOT"

After checking around, it seems that RAILS_ROOT was deprecated to Rails_root but that change is already present in the master code on Github so I'm not sure why I'm still getting that error.

Getting error "no such file to load -- pony (LoadError)" with Rails 3.0.5

Hi, thanks for the wonderful SMSFu.

I am trying to integrate it with Rails 3.0.5.
I am using

# ActionMailer delivery
$SMS_FU = SMSFu::Client.configure(:delivery => :action_mailer)

and don't want to use pony

I tried with gem version - '1.1.1' and '1.1.2' and also tried with plugin and able to successfully install.
But when tried to start the server, getting following error:

no such file to load -- pony (LoadError)

I did manage to get a fix of this by commenting "require 'pony'" line2 in plugin file "vendor/plugins/sms_fu/lib/sms_fu.rb"

You can find detailed error report here .

Not very sure about this issue, so thought to discuss with you.

Thanks
Ritesh Kumar

YAML parsing error

Calling .deliver threw an error that originates in the sms_fu.yml file:

Psych::SyntaxError: (): found character that cannot start any token while scanning for the next token at line 89 column 13

Psych is the YAML parser and doesn't play well with values starting with "@". Trying to wrap carrier values in strings (i.e. @gin.nl => "@gin.nl") didn't help. Calling YAML::ENGINE.yamler = 'syck' fixed the issue for me:
http://stackoverflow.com/questions/4980877/rails-error-couldnt-parse-yaml

What's the best approach here? Could we set YAML::ENGINE.yamler = 'syck' in the context of this gem without affecting the YAML settings of every app that installs it?

carrier_select missing when gem is used

I was using the sms_fu plugin with good results but upgraded to the gem today.

Now the view helpers are missing, but are still in the documentation - how do we get back the view helpers when using the gem?
thanks

Remove the action_mailer gem dependency

We'd like to use the sms_fu gem with a non-Rails app using Pony, but the way you have dependencies set up, we're still required to install the action_mailer gem. I may be reading the code wrong, but it looks like the action_mailer-dependent SMSNotifier is only really used in non-pony mode. Instead of a gem-requirement, how about just raising an error when an SMSFu::Client is configured to use :action_mailer and it's not installed?

Verizon Droid

Hey great gem! Things have worked really great for a majority of my app's users. I have had some users complaining recently though that the message body only contains the email address that I'm using to send the sms. It seems that the only users having the issue are Verizon Droid, Droid Pro, Droid X owners. Have you or anyone else using this method of email -> sms experienced anything similar? I can't find anything else on the web about issues sending sms via [number]@vtext.com.

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.