From 089c225e4d6382a5d751f3bb18143eb8352132ef Mon Sep 17 00:00:00 2001 From: rdbsolutions Date: Fri, 30 May 2025 14:23:13 +0100 Subject: [PATCH] 16578 link url updated --- pages/api/email/getall.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pages/api/email/getall.js b/pages/api/email/getall.js index 6e28f02a..e8a3ac4e 100644 --- a/pages/api/email/getall.js +++ b/pages/api/email/getall.js @@ -62,7 +62,8 @@ const buildNotifyPayloads = (watchlistByEmail) => { doc.pinswg_documentpublisheddate?.split("T")[0] ) || "No Date"; const link = - process.env.API_ROOT + doc.pinswg_hashlink || "[No Link]"; + process.env.NEXTAUTH_URL + doc.pinswg_hashlink || + "[No Link]"; return ` - ${ref}: ${name} (${date})\n Link: ${link}`; }) .join("\n"); @@ -139,7 +140,7 @@ const buildNotifyPayloads = (watchlistByEmail) => { )}\n` : ""; - const caseUnsubscribelink = `Unsubscribe to updates on this case https://${process.env.API_ROOT}/unsubscribe/${entry.pinswg_watchlistid}`; + const caseUnsubscribelink = `Unsubscribe to updates on this case https://${process.env.NEXTAUTH_URL}/unsubscribe/${entry.pinswg_watchlistid}`; return `Case: ${caseRef}\n${[ docSection, @@ -152,7 +153,7 @@ const buildNotifyPayloads = (watchlistByEmail) => { }) .join("\n\n"), unsubscribeLink: `Unsubscribe by selecting this link if you no longer want to receive any updates ${ - process.env.API_ROOT + "unsubscribeall/" + "contactId" + process.env.NEXTAUTH_URL + "unsubscribeall/" + "contactId" }`, }; @@ -162,7 +163,7 @@ const buildNotifyPayloads = (watchlistByEmail) => { personalisation, reference, oneClickUnsubscribeURL: - process.env.API_ROOT + "unsubscribe/" + "eee", + process.env.NEXTAUTH_URL + "unsubscribe/" + "eee", }; }) .filter(Boolean); // Remove any nulls from filtered-out users