Make alert email more efficient and case insenstiive; magic word is still 'alert'.
This commit is contained in:
parent
e1652a8d90
commit
b5e874235e
@ -120,7 +120,7 @@ app.post('/', function(req, res){
|
|||||||
stmt.finalize();
|
stmt.finalize();
|
||||||
|
|
||||||
// Send emails on alerts only
|
// Send emails on alerts only
|
||||||
if(JSON.stringify(req.body, null, 4).indexOf('alert') > -1){
|
if(status.toLowerCase().indexOf('alert') > -1){
|
||||||
mailOptions.text = status;
|
mailOptions.text = status;
|
||||||
transporter.sendMail(mailOptions, function(error, info){
|
transporter.sendMail(mailOptions, function(error, info){
|
||||||
if(error){
|
if(error){
|
||||||
|
Loading…
Reference in New Issue
Block a user