Gemfile:
gem 'mobitex'
Code:
Mobitex.configure { delivery_method :http, { :user => 'username', :pass => 'password' } }
Mobitex.deliver(:to => '48123456789', :body => 'Spam bacon sausage and spam')
Enjoy!
First, you must setup delivery method:
Mobitex.configure do
delivery_method :http, {
:user => 'username',
:pass => 'password'
}
end
Then you can just:
Mobitex.deliver(:to => '48123456789', :body => 'Egg sausage and bacon')
...which really is a shortcut for:
Mobitex::Message.new(:to => '48123456789', :body => 'Egg sausage and bacon')
You can use DSL to create new message:
message = Mobitex::Message.new do
to '48123456789'
body 'Egg, Bacon, Spam, Baked Beans, Spam, Sausage and Spam'
end