Permalink
Browse files

Merge pull request #6 from chrismatthieu/master

Pull Request to add outbound SMS notifications to Broadcast
  • Loading branch information...
2 parents 9715095 + d9ab266 commit c1a36f60559d1db6b5f3c988c3e982c22c2d168f @marcinbunsch marcinbunsch committed Jun 11, 2011
Showing with 36 additions and 0 deletions.
  1. +20 −0 README.markdown
  2. +16 −0 lib/broadcast/media/sms.rb
View
@@ -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
@@ -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

0 comments on commit c1a36f6

Please sign in to comment.