Integration with Ruby Toolbox

Ruby Toolbox is a simple and clear directory that contains all Rubygems. The interface actively supports popular open source programming libraries for the Ruby programming language. The Ruby Toolbox project is characterized not only by detailed descriptions, but also by carefully sorted libraries.

 

Advantages of SMS Club integration

The messaging service integrated into the program solves your tasks in a complex way with minimal participation of programmers. And the ability to send SMS asynchronously allows you to send many requests without waiting for a response.

 

Integration of the SMS and Viber mailing service allows you to:

  • automate the process of sending messages;
  • qualitatively segment the database;
  • personalize messages;
  • get basic analytics.

Thanks to sending SMS via XML API, the status of sent messages is available to the user.

Ruby SmsClub API Client – connection and configuration

SmsClub API Client

Client for SMS gate. Allows you to send and retrieve status of sent SMS via XML API.

Installation

Add this line to your application’s Gemfile:

gem 'sms-club'

 

And then execute:

$ bundle

 

Or install it yourself as:

$ gem install sms-club

 

Usage

1. Create new client first. Constructor accepts your login, password for smsclub.mobi and optional default from argument

SmsClub::Client.new '380993123123', 'password', from: 'CoolCompany'
#=> #

 

2. You can also turn on transliteration option by default

client = SmsClub::Client.new '380993123123', 'password', transliterate: true
#=> #

 

3. Sending SMS to multiple numbers at once

client.send 'test', to: ['+380664018206', '+380666018203', '+380666018202']
#=> ["ID_1", "ID_2", "ID_N"]

 

4. Send sms to one number

client.send_one 'test', to: '+380666128206'
#=> "ID_1"

 

5. Get status of SMS

client.status_for 'ID_1'
#=> :delivrd

client.statuses_for ['ID_1', 'ID_2']
#=> { 'ID_1' => :delivrd }, { 'ID_2' => :delivrd }

For more info please see original api docs.

 

Resque

1.  It also support asynchronous SMS sending with Resque gem

require 'sms-club/resque'
client = SmsClub::AsyncClient.new '380993123123', 'password', from: 'CoolCompany'
client.send_async 'async test', to: ['+380664018206', '+380666018203', '+380666018202']

 

2.  When Redis server is not available it automatically switches to synchronous mode.
3. Make sure Resque is added to your Gemfile.

Contributing

1. Fork it

(https://github.com/pavel-d/sms-club/fork)

 

2. Create your feature branch

git checkout -b my-new-feature

 

3. Commit your changes

git commit -am 'Add some feature'

 

4. Push to the branch

git push origin my-new-feature

 

5. Create a new Pull Request

Details about Ruby

TOP