Git Product home page Git Product logo

txtlocal's Introduction

txtlocal.co.uk API Wrapper

This gem is intended to provide a simple API for sending text messages via txtlocal's API.

Installing

Add the gem to your gemfile

gem 'txtlocal', :git => 'git://github.com/epigenesys/txtlocal.git'

Usage

Configure the default settings

Txtlocal.config do |c|
  c.from = "My App"
  c.username = "txtlocal_username"
  c.password = "txtlocal_password"
end

Use Txtlocal.send_message to send messages

Txtlocal.send_message("You have 1 new friend request!", "07729435xxx")

Or create a message manually

msg = Txtlocal::Message.new
msg.body = "Tickets will be available tomorrow morning at 9am"
msg.recipients = ["0712 3893 xxx", "447923176xxx"]
msg.add_recipient "+447729435xxx"
msg.send!

You can override the sender on a per message basis

Txtlocal.send_message("You have 1 new friend request!", "07729435xxx", :from => "someone")

msg = Txtlocal::Message.new
msg.from = "a mystery"

Testing

Set test = true in the configuration to use the API's test mode

Txtlocal.config.test = true
Txtlocal.config.testing?
  => true

txtlocal's People

Contributors

wilde4 avatar

Watchers

 avatar 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.