diff --git a/server.js b/server.js index 3f5cb87..8cc306d 100644 --- a/server.js +++ b/server.js @@ -120,7 +120,7 @@ app.post('/', function(req, res){ stmt.finalize(); // Send emails on alerts only - if(JSON.stringify(req.body, null, 4).indexOf('alert') > -1){ + if(status.toLowerCase().indexOf('alert') > -1){ mailOptions.text = status; transporter.sendMail(mailOptions, function(error, info){ if(error){