msg->message
This commit is contained in:
		
							
								
								
									
										12
									
								
								app.js
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								app.js
									
									
									
									
									
								
							@@ -29,20 +29,20 @@ app.post('/text', function(req, res) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  redis.incr(keystr, function(err, num) {
 | 
					  redis.incr(keystr, function(err, num) {
 | 
				
			||||||
    if (err) {
 | 
					    if (err) {
 | 
				
			||||||
      res.send({success:false,msg:'Could not validate IP quota.'});
 | 
					      res.send({success:false,message:'Could not validate IP quota.'});
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (num < 51) {
 | 
					    if (num < 51) {
 | 
				
			||||||
      sendText(req.body.number, req.body.msg, function(err) {
 | 
					      sendText(req.body.number, req.body.message, function(err) {
 | 
				
			||||||
        if (err)
 | 
					        if (err)
 | 
				
			||||||
          res.send({success:false,msg:'Communication with SMS gateway failed.'});
 | 
					          res.send({success:false,message:'Communication with SMS gateway failed.'});
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
          res.send({success:true});
 | 
					          res.send({success:true});
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
      res.send({success:false,msg:'Exceeded quota.'});
 | 
					      res.send({success:false,message:'Exceeded quota.'});
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  });
 | 
					  });
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
@@ -55,7 +55,7 @@ function dateStr() {
 | 
				
			|||||||
  return mm + '/' + dd + '/' + yyyy;
 | 
					  return mm + '/' + dd + '/' + yyyy;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function sendText(phone, msg, cb) {
 | 
					function sendText(phone, message, cb) {
 | 
				
			||||||
  var transport = nodemailer.createTransport("SES", {
 | 
					  var transport = nodemailer.createTransport("SES", {
 | 
				
			||||||
    AWSAccessKeyID: config.aws.access,
 | 
					    AWSAccessKeyID: config.aws.access,
 | 
				
			||||||
    AWSSecretKey: config.aws.secret,
 | 
					    AWSSecretKey: config.aws.secret,
 | 
				
			||||||
@@ -66,7 +66,7 @@ function sendText(phone, msg, cb) {
 | 
				
			|||||||
    from: "txt@textbelt.com", // sender address
 | 
					    from: "txt@textbelt.com", // sender address
 | 
				
			||||||
    to: '9147727429@vtext.com',
 | 
					    to: '9147727429@vtext.com',
 | 
				
			||||||
    subject: '', // Subject line
 | 
					    subject: '', // Subject line
 | 
				
			||||||
    text: msg,
 | 
					    text: message,
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  nodemailer.sendMail(mailOptions, function(error){
 | 
					  nodemailer.sendMail(mailOptions, function(error){
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user