Dynmark

Dynmark is a simple gem which allows one to use Dynmark SMS services from within a Ruby on Rails application.

View the pricing information here if one would wish to use their services:

www.dynmark.com/pricing.aspx

It has been built on Rails 3.1.

In order to use the gem work through the following steps:

  1. Add gem ‘dynmark’ to the project Gemfile.

  2. Execute bundle install from the command line at the root of the project.

  3. Execute the following command in order to bring the migration file into the project.

    rails generate dynmark:install -s
    
  4. Execute “rake db:migrate” in order to create the “sms_queues” table within the project’s database.

  5. Finally execute “rake setup_dynmark” to copy up the dynmark.yml file to the project.

The dynmark.yml simply stores the account username and password credentials provided by Dynmark to access their services.

This gem provides the form (currently styleless) to send adhoc SMS messages.

Simply follow: app_root/sms_queues/new to access the form.

The gem also makes it possible to create new SMS messages using the following route and providing the username and password in the parameters.

For example:

Scenario could be a background service polling a table for messages to send. It will pick up the details and send a new message using the “send_sms_message” method on the SmsQueue model within the gem (this is the primary purpose of the gem for now):

queue = Hash.new
queue[:name] = "username"
queue[:password] = "password"
queue[:originator] = "Torex"
queue[:text] = "message"
queue[:recipient] = "mobile number"
response = SmsQueue.send_sms_message(queue)

The main intention is to use this gem in conjunction with the “whenever” gem.

More changes are required to this gem. Details of which will be provided shortly.

Copyright 2012 Torex Retail Holdings Limited.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.