diff --git a/emailnotif.js b/emailnotif.js
index ec7ff79..f7029d6 100644
--- a/emailnotif.js
+++ b/emailnotif.js
@@ -3,7 +3,8 @@ const db = require('./config/dbproc.js');
const RECIPIENT = 'rizki.rmdhn1304@gmail.com';
-function buildHtml(approverName, title, priorName) {
+function buildHtml(approverName, title, priorName, idxjustification) {
+ const url = `https://e-portal.telkomcel.tl/app/ext/eproc/circulation/${idxjustification}`;
return `
Dear ${approverName},
A new workflow task requires your review and approval. Please find the details regarding this justification below:
@@ -13,17 +14,17 @@ function buildHtml(approverName, title, priorName) {
- Sent By: ${priorName}
Action Required:
-https://e-portal.telkomcel.tl/app/ext/eproc/
+${url}
Best regards,
E-Procurement
`;
}
-function postEmail(approverName, title, priorName) {
+function postEmail(approverName, title, priorName, idxjustification) {
const payload = JSON.stringify({
to: [RECIPIENT],
cc: [],
bcc: [],
subject: `[Approval Required] Justification for ${title}`,
- html: buildHtml(approverName, title, priorName)
+ html: buildHtml(approverName, title, priorName, idxjustification)
});
const req = http.request({
@@ -77,7 +78,7 @@ function notifyOnSubmit(idxjustification) {
console.error('[email-notif] notifyOnSubmit: no approver found', err2);
return;
}
- postEmail(rows2[0].fullname, title, creatorName);
+ postEmail(rows2[0].fullname, title, creatorName, idxjustification);
});
});
}
@@ -114,7 +115,7 @@ function notifyOnSigned(idxjustification, signerNik) {
console.log('[email-notif] notifyOnSigned: no more approvers to notify');
return;
}
- postEmail(rows3[0].fullname, title, signerName);
+ postEmail(rows3[0].fullname, title, signerName, idxjustification);
});
});
});