Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sms-club

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sms-club

  • 0.3.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SmsClub API Client Gem Version

Client for http://smsclub.mobi/ 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

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

SmsClub::Client.new '380993123123', 'password', from: 'CoolCompany'
#=> #<SmsClub::Client:0x000000051f9320 @user_name="380993123123", @password="password", @from="CoolCompany", @transliterate=false>

You can also turn on transliteration option by default

client = SmsClub::Client.new '380993123123', 'password', transliterate: true
#=> #<SmsClub::Client:0x000000051b14d0 @user_name="380993123123", @password="password", @from=nil, @transliterate=true>

Sending SMS to multiple numbers at once

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

Send sms to one number

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

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 http://smsclub.mobi/en/pages/show/api#xml

Resque

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']

When Redis server is not available it automatically switches to synchronous mode.

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

FAQs

Package last updated on 29 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc