Skip to content

rodrigoarino/smsc-ar

 
 

Repository files navigation

Smsc-ar

Welcome to smc-ar the gem to send sms via (www.smsc.com.ar).

Installation

Add this line to your application's Gemfile:

gem 'smsc-ar', '~> 0.0.1'

And then execute:

$ bundle

Or install it yourself as:

$ gem install smsc-ar

Usage

Create a instance

sms = Smsc.new("your_alias", "your_apikey")

And then.. Check if the service is active

sms.active?

# => true

Check the service status

sms.status

# => {:code=>200, :message=>""}

Check your account balance

sms.balance

# => 557

Check the messages received

sms.received

# => {:id=>"8324966", :date=>"2017-07-19T02:01:02Z", :message=>"#14691 message test", :from=>"0", :phone=>"0"}

Check the messages sent

sms.sent

# => {:id=>"8889563", :date=>"2017-08-09T00:51:52Z", :message=>"#14691 message test", :recipients=>[{:code_area=>"3584", :phone=>"316256", :status=>"Entregado"}]}

Send a SMS

sms.send("your_phone_number", "your_message") # Example sms.send("0358-154316256","Hey, Casper, Are you there?")

# => true

See the messages enqueued to send later

# priority 0:all 1:low 2:mid 3:hight

sms.enqueued(0)

# => 7234

Check if the number is valid to send a sms

sms.valid_phone?('0358-154316256')

# => true

Cancel all messages enqueued

sms.cancel_queue

# => true

Check if the last action have errors

sms.errors?

# => false

Retrieve the errors of the last action

sms.errors

# => "Unauthorized access"

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/ezedepetris/smsc-ar/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

License

The gem is available as open source under the terms of the MIT License.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 98.3%
  • Shell 1.7%