Skip to content

juseveno/sms_factor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMS Factor

An easy way to use API SMS of www.smsfactor.com/ (www.smsfactor.com/api-sms/)

Installation

You can install sms_factor by adding this line in your Gemfile :

gem 'sms_factor'

And then :

bundle install

Configuration

To use this gem, configure SmsFactor using your API information :

SmsFactor::Init.configure do |config|
  config.api_url          = 'http://api.smsfactor.com'
  config.api_login        = '<your_email@your_company.com>'
  config.api_password     = '<your_password>'
  config.api_default_from = '<a_default_sender_name>'
end

Use

To send a SMS :

r = SmsFactor.sms('Hello World', '336++++++++') # to a single recipient
r = SmsFactor.sms('Hello World', ['336++++++++', '336++++++++', '336++++++++']) # to multiple recipients
r = SmsFactor.sms('Hello World', '336++++++++', 'Toto') # to override default from

To retrieve your credit after the sms was sent :

r.credit

Copyright © 2015 Julien Séveno

Releases

No releases published

Packages

No packages published

Languages