Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added SMS medium using the SMSified gem to allow Broadcast users to s…

…end SMS messages to any US mobile device.
  • Loading branch information...
commit d9ab266e3d325494729f11dbd5b28e37681f4b9d 1 parent 9715095
@chrismatthieu chrismatthieu authored
Showing with 36 additions and 0 deletions.
  1. +20 −0 README.markdown
  2. +16 −0 lib/broadcast/media/sms.rb
View
20 README.markdown
@@ -226,6 +226,26 @@ It is based on the assumption that the user associated with the access token has
end
```
+### SMS
+
+Broadcast::Medium::SMS is based on the SMSified gem.
+You must create an account on http://smsified.com before sending SMS text messages (developer accounts are free).
+You will be given a phone number to use as your very own FROM sms number. This number, along with your username and password,
+must be added to your config during setup. The To address is the address of the mobile number that you would like to send the SMS message to.
+
+#### Example setup
+
+```ruby
+ Broadcast.setup do |config|
+ config.Sms { |sms|
+ sms.username = 'myaccount'
+ sms.password = 'mypass'
+ sms.from = '16025551212'
+ sms.to = '14801234567'
+ }
+ end
+```
+
Copyright
---------
View
16 lib/broadcast/media/sms.rb
@@ -0,0 +1,16 @@
+require 'smsified'
+
+class Broadcast::Medium::Sms < Broadcast::Medium::Oauth
+
+ def publish(message)
+
+ oneapi = Smsified::OneAPI.new :username => options.username,
+ :password => options.password
+
+ oneapi.send_sms :address => options.to,
+ :message => message.body,
+ :sender_address => options.from
+
+ end
+
+end
Please sign in to comment.
Something went wrong with that request. Please try again.