Consolidated clockwork updates

This commit is contained in:
Sahat Yalkabov
2014-02-27 19:42:07 -05:00
parent 007d561d88
commit e5cb5607db
2 changed files with 5 additions and 4 deletions

View File

@ -416,7 +416,7 @@ exports.postTwilio = function(req, res, next) {
/**
* GET /api/Clockwork
* GET /api/clockwork
* Clockwork SMS API example.
*/
@ -434,13 +434,14 @@ exports.getClockwork = function(req, res, next) {
*/
exports.postClockwork = function(req, res, next) {
console.log('hi')
var message = {
To: req.body.telephone,
From: 'Hackathon',
Content: 'Hello from the Hackathon Starter'
};
clockwork.sendSms(message, function(err, responseData) {
if (err) return next(err.message);
if (err) return next(err.errDesc);
req.flash('success', { msg: 'Text sent to ' + responseData.responses[0].to});
res.redirect('/api/clockwork');
});

View File

@ -6,6 +6,8 @@ block content
ol
li
a(href='/api/aviary') Aviary
li
a(href='/api/clockwork') Clockwork SMS
li
a(href='/api/facebook') Facebook
small ⇢ Login Required
@ -29,8 +31,6 @@ block content
a(href='/api/steam') Steam
li
a(href='/api/twilio') Twilio
li
a(href='/api/clockwork') Clockwork SMS
li
a(href='/api/tumblr') Tumblr
small ⇢ Login Required