Permalink
Browse files

fixing up some holes

  • Loading branch information...
1 parent 1712130 commit 60508833704258ad98744e6b0702c041ab801f40 @kwhinnery committed Jan 29, 2013
Showing with 16 additions and 8 deletions.
  1. +11 −1 cloud/cloudConfig.sample.js
  2. +1 −1 cloud/main.js
  3. +4 −6 www/js/app.js
@@ -1,4 +1,14 @@
+//Your Twilio account credentials
exports.accountSid = 'ACXXX';
exports.authToken = 'XXX';
+
+//A Twilio number you control
exports.from = '+16515556677';
-exports.message = 'Download ReadGood now! Here\'s the link :) ';
+
+//The message prepended to the text message link
+exports.message = 'Download ReadGood now! Here\'s the link :) ';
+
+//Change this to be wherever you end up deploying your HTML files
+//You might also consider using a shortened link to save space in
+//your message.
+exports.downloadLink = 'http://mad.site44.com/download.html';
View
@@ -15,7 +15,7 @@ Parse.Cloud.define('sendLink', function(request, response) {
twilio.sendSMS({
From: cloudConfig.from, //a twilio number you control
To: n,
- Body: cloudConfig.message+request.params.redirect
+ Body: cloudConfig.message + cloudConfig.downloadLink
}, {
success: function(httpResponse) {
console.log(httpResponse);
View
@@ -49,24 +49,22 @@
$submit.on('click', function(e) {
toggle(false);
- //Get a link to the download redirect page - should be on the same domain, same level, at download.html
- var link = window.location.protocol + '//' + window.location.host + '/download.html';
+ var $info = $('#info');
//execute Parse cloud code to send an SMS
Parse.Cloud.run('sendLink', {
- phoneNumber:$phoneNumber.val(),
- redirect:link
+ phoneNumber:$phoneNumber.val()
}, {
success:function(response) {
- $('#info').removeClass('error')
+ $info.removeClass('error')
.addClass('info')
.html('Awesome! The link should be on it\'s way.')
.fadeIn();
toggle(true);
},
error: function(response) {
- $('#info').removeClass('info')
+ $info.removeClass('info')
.addClass('error')
.html('There was a problem sending the link - please check your number and try again')
.fadeIn();

0 comments on commit 6050883

Please sign in to comment.