Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 1.19 KB

README.md

File metadata and controls

62 lines (44 loc) · 1.19 KB

Mobitex gem - wrapper to mobitex API

Build Status Dependency Status

How to use it?

Gemfile:

gem 'mobitex'

Code:

Mobitex.configure { delivery_method :http, { :user => 'username', :pass => 'password' } }
Mobitex.deliver(:to => '48123456789', :body => 'Spam bacon sausage and spam')

Enjoy!

More usage examples

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