From f75fd9805a741155f7dc635c5861a95ff8d4f96e Mon Sep 17 00:00:00 2001 From: Rizki Date: Fri, 10 Apr 2026 14:41:45 +0700 Subject: [PATCH] upd --- emailnotif.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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:

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); }); }); });