super_p && web

my little piece of "work memory"

16 notes &

Ruby wrapper for startmobile sms service

This gem provide the easy way to send and check a single sms with startmobile.com.ua service.

Install

gem 'startmobile_sms'

Configure

StartmobileSms.setup do |config|
  config.login = 'login'
  config.password = 'password'
  config.out_number = 'out_number'
end

Usage

# Send single sms (out_number is optional)
sms_id = StartmobileSms.send(:phone => '30971234567', :text => 'Hello!', :out_number => 'service_name')

# Check sms delivery status
StartmobileSms.check(sms_id)

# Or use instance object
sms = StartmobileSms::Message.new(:phone => '30971234567', :text => 'Hello!')

sms.phone # 30971234567
sms.text # Hello!
sms.send # send sms to server
sms.id # response id

sms.status # check sms status (Accepted, Enroute, Delivered, Expired, Deleted, Undeliverable, Rejected

Filed under ruby on rails ruby sms startmobile git

  1. superp posted this