diff --git a/emailnotif.js b/emailnotif.js index 2358d26..5bd9443 100644 --- a/emailnotif.js +++ b/emailnotif.js @@ -122,7 +122,7 @@ function notifyOnSubmit(idxjustification) { const qryApprover = ` select t.nik, e.fullname, e.email from tbl_justificationttd t - join dbssotcel.tbl_employee e on e.nik = t.nik AND email != '-' + join dbssotcel.tbl_employee e on e.nik = t.nik AND e.email is not null AND e.email != '-' where t.idxjustification = '${idxjustification}' and t.issigned = 0 and t.isdeleted = 0 order by t._idx asc limit 1 `; @@ -160,7 +160,7 @@ function notifyOnSigned(idxjustification, signerNik) { const qryNext = ` select t.nik, e.fullname, e.email from tbl_justificationttd t - join dbssotcel.tbl_employee e on e.nik = t.nik AND email != '-' + join dbssotcel.tbl_employee e on e.nik = t.nik AND e.email is not null AND e.email != '-' where t.idxjustification = '${idxjustification}' and t.issigned = 0 and t.isdeleted = 0 order by t._idx asc limit 1 `; @@ -195,7 +195,7 @@ function notifyOnReturn(idxjustification, returnerNik) { const creatorName = rows[0].creator_name; const creatorEmail = rows[0].creator_email; - const qryReturner = `select fullname from dbssotcel.tbl_employee where nik = '${returnerNik}' AND email != '-' limit 1`; + const qryReturner = `select fullname from dbssotcel.tbl_employee where nik = '${returnerNik}' AND email is not null AND email != '-' limit 1`; db.query(qryReturner, [], function(err2, rows2) { if (err2 || rows2.length === 0) { console.error('[email-notif] notifyOnReturn: failed to get returner name', err2);