0.0
No commit activity in last 3 years
No release in over 3 years
Ruby SDK for smsmanager.cz API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

SmsManager

Gem Version Build Status Code Climate Coverage Status

A Ruby SDK for smsmanager.cz - Czech SMS provider.

Installation

gem install sms_manager

Or add to Gemfile:

gem 'sms_manager'

Usage

First you need to setup your credentials:

SmsManager.configure do |config|
  config.username = YOUR_USERNAME
  config.hashed_password = HASHED_PASSWORD
end

Create the password hash with SHA-1 in console and then put the string into the configuration block:

require 'digest/sha1'
Digest::SHA1.hexdigest 'password'

That's all. Now you can send SMS messages.

SmsManager.send number: '+420123456789', message: 'Hello!'

You can pass all the parameters available at SmsManager API. These additional parameters will be appended to the request:

SmsManager.send number: '+420123456789', message: 'Hello!', gateway: 'lowcost', time: '2013-01-01T23:59:59'

If the service fails an exception is raised:

begin
  SmsManager.send number: '+420123456789', message: 'Hello!'
rescue SmsManager::Error => e
  puts e.message # => Neplatný parametr gateway
end

Copyright

Copyright (c) 2013 David Hrachovy See LICENSE for details.