Socket
Book a DemoInstallSign in
Socket

exetel_sms

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exetel_sms

1.05
bundlerRubygems
Version published
Maintainers
1
Created
Source

exetel_sms: Send and receive messages via Exetel's SMS API

gem install 'exetel_sms'

Send a message:

require 'exetel_sms' config = ExetelSms::Config.new('username', 'password') sender = ExetelSms::Sender.new(config) result = sender.send( 'destination mobile number', 'message', 'from string', sender.class.new_reference_number('application_identifier') ) if result.success? puts "Message sent successfully!" else puts "Error sending message: #{result[:notes]}" end

Was it really sent?

retriever = ExetelSms::Retriever.new(config) result = retriever.check_sent('reference_number') result[:message_status] => 'Sent'

Receiving messages from a Virtual Mobile Number

receiver = ExetelSms::Receiver.new(config) if result = receiver.receive('my virtual mobile number') puts "Received from #{result[:from_mobile_number]}: #{result[:message]}" end

Then you can delete the messages with ExetelSms::Deleter

Credit Check - also useful as a ping before sending

checker = ExetelSms::CreditCheck.new(config) if result = checker.get_credit_limit puts "Credit limit is #{result[:limit]}" end

Test API - test responses without making actual HTTP calls

good = ExetelSms::Client.with_test_api { retriever.check_sent('1') } good[:message_status] # => 'Delivered'

bad = ExetelSms::Client.with_test_api(:fail) { retriever.check_sent('1') } bad[:message_status] # => 'Failed'

Sent messages end up in ExetelSms::Client.sent_messages array. See test/ for more examples.

Contact the author

Andrew Snow andrew@modulus.org Andys^ on irc.freenode.net @andy_snow on Twitter

FAQs

Package last updated on 29 Mar 2011

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.