README.md in cellular-1.2.0 vs README.md in cellular-1.3.0

- old
+ new

@@ -1,16 +1,16 @@ # Cellular -[![Gem Version](https://badge.fury.io/rb/cellular.png)](https://rubygems.org/gems/cellular) -[![Build Status](https://secure.travis-ci.org/hyperoslo/cellular.png?branch=master)](https://travis-ci.org/hyperoslo/cellular) -[![Dependency Status](https://gemnasium.com/hyperoslo/cellular.png)](https://gemnasium.com/hyperoslo/cellular) -[![Code Climate](https://codeclimate.com/github/hyperoslo/cellular.png)](https://codeclimate.com/github/hyperoslo/cellular) -[![Coverage Status](https://coveralls.io/repos/hyperoslo/cellular/badge.png?branch=master)](https://coveralls.io/r/hyperoslo/cellular) +[![Gem Version](https://img.shields.io/gem/v/cellular.svg?style=flat)](https://rubygems.org/gems/cellular) +[![Build Status](https://img.shields.io/travis/hyperoslo/cellular.svg?style=flat)](https://travis-ci.org/hyperoslo/cellular) +[![Dependency Status](https://img.shields.io/gemnasium/hyperoslo/cellular.svg?style=flat)](https://gemnasium.com/hyperoslo/cellular) +[![Code Climate](https://img.shields.io/codeclimate/github/hyperoslo/cellular.svg?style=flat)](https://codeclimate.com/github/hyperoslo/cellular) +[![Coverage Status](https://img.shields.io/coveralls/hyperoslo/cellular.svg?style=flat)](https://coveralls.io/r/hyperoslo/cellular) Sending and receiving SMSs with Ruby through pluggable backends. -**Supported Ruby versions: 1.9.3 or higher** +**Supported Ruby versions: 2.0.0 or higher** Licensed under the **MIT** license, see LICENSE for more information. ## Installation @@ -36,32 +36,57 @@ Cellular.configure do |config| config.username = 'username' config.password = 'password' config.backend = Cellular::Backends::Sendega config.sender = 'Default custom sender' + config.country_code = 'NO' end ``` ### Available Backends -* CoolSMS (http://coolsms.com/) -* Sendega (http://sendega.com/) +* [CoolSMS](http://coolsms.com/) +* [Sendega](http://sendega.com/) +* Log (logs to `$stdout`) +* Test (adds messages to `Cellular.deliveries`) ### Sending SMSs The options supported may differ between backends. ```ruby sms = Cellular::SMS.new( recipient: '47xxxxxxxx', sender: 'Custom sender', - message: 'This is an SMS message' + message: 'This is an SMS message', + price: 0, + country_code: 'NO' # defaults to Cellular.config.country_code ) sms.deliver ``` + +You can also use Sidekiq to send texts, which is great if you're in a Rails app +and are concerned that it might time out or something. Actually, if you have +Sidekiq at your disposal, it's a great idea anyway! To use it, just call +`deliver_later` instead of `deliver` on the SMS object: + +```ruby +sms = Cellular::SMS.new( + recipient: '47xxxxxxxx', + sender: 'Custom sender', + message: 'This is an SMS message' +) + +sms.deliver_later +``` + +This will create a Sidekiq job for you on the **cellular** queue, so make sure +that Sidekiq is processing that queue. + +[sidekiq]: http://sidekiq.org ## Contributing 1. Fork it