GithubHelp home page GithubHelp logo

kaakati / unifonic_sms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from assemdeghady/unifonic_sms

0.0 1.0 0.0 21 KB

A Ruby gem to send SMS text messages via Unifonic SMS gateway

Home Page: http://www.unifonic.com/

License: MIT License

Ruby 99.75% Shell 0.25%

unifonic_sms's Introduction

Unifonic Sms

A Ruby client that allows you to send SMS messages via Unifonic.

See Messages section in the Api Documentation to learn about the available actions.

Note: All and only the messages methods are supported plus the account's get balance method.

Installation

Add this line to your application's Gemfile:

gem 'unifonic_sms'

And then execute:

$ bundle

Or install it yourself as:

$ gem install unifonic_sms

Usage

First make an initializer unifonic_sms.rb inside config/initializers and add the configurations

UnifonicSms.configure do |config|
  config.api_key = "xxxxxx-xxxxxxxxx-xxxxxx-xxxxxxxxxx"
  config.sender_phone = "1234567890123"
end

Then start using the available module methods

# Get Account Balance.
UnifonicSms.balance

# Send SMS Message.
UnifonicSms.send_message("+012347647843", "Test Message Body")

# Send Bulk SMS Messages.
UnifonicSms.send_bulk("12347647843, 12391283123, 1209831923, 12031293102", "Test Message Body")

# Get SMS Message Status.
UnifonicSms.message_status(3902) # message_id

# Get SMS Messages Report.
UnifonicSms.messages_report

# Get SMS Message Details.
UnifonicSms.messages_details

# Get Schedualed SMS Messages.
UnifonicSms.schedualed_messages

# Stop Schedualed SMS Message.
UnifonicSms.stop_schedualed_messages(3902) # message_id

# Create Keyword.
UnifonicSms.keyword("127318923789", "google", "www.google.com")

# Get Inbox Messages.
UnifonicSms.inbox("127318923789")

# Get Pricing Details. 
UnifonicSms.pricing("KSA") # Country Code

Testing:

By default calls are stubbed, If you want to disable the stubbing you must make @mock_test equal false in the spec_helper.rb file, Then make sure to set all the other variables in the spec_helper.rb file to real values.

Generate documentation:

You must have Yard gem installed.

yardoc

Documentation will be generated in /docs

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

License

The gem is available as open source under the terms of the MIT License.

unifonic_sms's People

Contributors

assemdeghady avatar kbackowski avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.