New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sms_centre

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sms_centre

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SMSCentre

Send SMS via SMS Centre gateway

Installation

Add this line to your application's Gemfile:

gem 'sms_centre'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sms_centre

Usage

  1. Register at http://smscentre.com

  2. Create api object:

    api = SMSCentre::API.new('your_login', 'your_password')
    
  3. Send sms:

    # Single phone
    result = api.broadcast('PHONENUMBER1', 'This is message text')
    
    # Multiple phones
    result = api.broadcast(['PHONENUMBER1', ...], 'This is message text')
    
    # Optional, you can set sender name and message id (can be used for status check)
    result = api.broadcast('PHONENUMBER1', 'This is message text', params: {sender: 'SENDER NAME', id: 'MESSAGE_ID'}
    
    # Get phone status code
    result.status_for 'PHONENUMBER1'
    
    # Or get localized status string (only russian supported yet)
    result.human_status_for 'PHONENUMBER1'
    
  4. Get sms status by phone number and message id:

    status = api.status('MESSAGE_ID', 'PHONENUMBER1')
    
    # Get status code
    status.status
    
    # Get get localized status string
    status.human_status
    
    # More generic status checks
    status.delivered? # Is message delivered?
    status.pending?   # Is message in queue yet?
    status.failed?    # Is message delivery failed for some reason?
    
  5. Check your balance:

    api.balance
    # => '999.99'
    

Configure

Paste this code in some file, load it before send sms (rails hint: initializer is the best place to do it)

SMSCentre.configure.do |config|
  # For example, disable SSL
  config.use_ssl = false
end

See options list in source code

Contributing

  1. Fork it
  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 new Pull Request

FAQs

Package last updated on 30 Sep 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