Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 1.14 KB

README.md

File metadata and controls

61 lines (44 loc) · 1.14 KB

ruby plugin for mobtexting

This package makes it easy to send Mobtexting notifications.

Installation

Add the dependency to your Gemfile

gem 'mobtexting_sms', :git => 'https://github.com/mobtexting/mobtexting-ruby.git'

Then run:

bundle install

Send SMS Usage

require "mobtexting_sms"

access_token = 'xxxxxxxxxxxxxxxxx'

client = MobtextingSms::Client.new(access_token)
response = client.send(
        '1234567890', # to phone number
        'MobTxt', # sender
        'hello from ruby!', # message body
        'P' # service
)

puts(response)

Verify Usage

Send

verify = MobtextingSms::Verify.new(access_token)
response = verify.send('1234567890') # to phone number
puts(response)

Check

verify = MobtextingSms::Verify.new(access_token)
response = verify.check(
	'705f1cd4-93e0-492e-b6f8-ffdf9dac68f5', # id received while send
	'123456' # token entered by user
)
puts(response)

Cancel

verify = MobtextingSms::Verify.new(access_token)
response = verify.cancel('705f1cd4-93e0-492e-b6f8-ffdf9dac68f5') # id received while send
puts(response)