##Module that sends an SMS thru the Chikka API
'use strict';
var util = require('../../helpers/util'),
superagent = require('superagent'),
config = {
endpoint : 'https://post.chikka.com/smsapi/request',
shortcode : /*Your shortcode here*/,
client_id : /*Your client_id here*/,
secret_key : /*Your secret_key here*/
};
exports.send_sms = function (message, mobile_number, callback){
var daily_id = util.random_id(32);
superagent.post(config.endpoint)
.set('mobile_number', mobile_number)
.set('shortcode', config.shortcode)
.set('message_id', daily_id)
.set('client_id', config.client_id)
.set('secret_key', config.secret_key)
.end(callback);
};
##Contents of util.js
'use strict';
exports.random_id = function (length) {
return '' + (Math.random() * Math.pow(10,16));
};