
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
Send SMS via SMS Centre gateway
Add this line to your application's Gemfile:
gem 'sms_centre'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sms_centre
Register at http://smscentre.com
Create api object:
api = SMSCentre::API.new('your_login', 'your_password')
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'
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?
Check your balance:
api.balance
# => '999.99'
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
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)FAQs
Unknown package
We found that sms_centre demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.