summaryrefslogtreecommitdiffstats
path: root/README.rdoc
blob: af046deeac4c84fda824b7f1d7f0486375b0fade (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
= 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 ...

== Opt-In Warning for Some International Carriers

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 carriers that need this include, Mobitel, Etisalat, T-Mobile (Netherlands), 
etc.

== 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 http://github.com/brendanlim/sms-fu/tree/plugin

== Setup Instructions

* Install sms_fu gem
  
  sudo gem install sms_fu
  
* Add sms_fu.yml to your config folder (Rails only)

  http://github.com/brendanlim/sms-fu/blob/master/templates/sms_fu.yml

* (Optional) Modify sms_fu.yml in your config folder with your reply-to e-mail address.

== 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 specify the 
  :pony_options as well, if necessary.  
  
    # ActionMailer delivery
    sms_fu = SMSFu.configure(:action_mailer)

    # Pony delivery via Sendmail
    sms_fu = SMSFu.configure(:pony, :pony_options => { :via => :sendmail })

    # Pony delivery via SMTP
    sms_fu = SMSFu.configure(:pony, :pony_options => { :via => :smtp, 
        :via_options => {
          :address              => 'smtp.gmail.com',
          :port                 => '587',
          :user_name            => 'username',
          :password             => 'password',
          :authentication       => :plain, 
          :domain               => "localhost.localdomain"
          :enable_starttls_auto => true,
      }})
      
* You can view more pony 'via_options' at http://github.com/benprew/pony
      
* Basic 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 => "bob@test.com")

* 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.

    sms_fu.sms_address("5558675309","at&t") # => "5558675309@txt.att.net"

== 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 (c) 2010 Brendan G. Lim, Intridea, Inc., released under the MIT license