From 41ff3587bd140f414e854b25774a0e652ed65b5b Mon Sep 17 00:00:00 2001 From: potts99 Date: Thu, 11 Apr 2024 00:01:51 +0100 Subject: [PATCH 1/2] fix missing html & remove unused func --- apps/api/src/lib/imap.ts | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/apps/api/src/lib/imap.ts b/apps/api/src/lib/imap.ts index 6d8449a79..aaaf94c6a 100644 --- a/apps/api/src/lib/imap.ts +++ b/apps/api/src/lib/imap.ts @@ -14,38 +14,6 @@ const year = date.getFullYear(); //@ts-ignore const d = new Date([year, month, today]); -function parseEmailContent(emailText: any) { - const lines = emailText.split("\n"); - const parsedData = { - name: "", - email: "", - phoneNumbers: [], - addresses: [], - companyDetails: "", - }; - - let inAddressSection = false; - - lines.forEach((line: any) => { - if (line.includes("@")) { - parsedData.email = line.trim(); - } else if (line.includes("US:") || line.includes("UK:")) { - //@ts-ignore - parsedData.phoneNumbers.push(line.trim()); - } else if (line.includes("ISO")) { - parsedData.companyDetails = line.trim(); - } else if (line.trim() === "North America:" || line.trim() === "Europe:") { - inAddressSection = true; - //@ts-ignore - } else if (inAddressSection && line.trim() !== "") { - //@ts-ignore - parsedData.addresses.push(line.trim()); - } - }); - - return parsedData; -} - export const getEmails = async () => { try { const queues = await client.emailQueue.findMany({}); @@ -87,7 +55,7 @@ export const getEmails = async () => { console.log("from", from); - const parsedData = parseEmailContent(textAsHtml); + // const parsedData = parseEmailContent(textAsHtml); if (subject !== undefined && subject.includes("Re:")) { return await client.comment.create({ @@ -116,7 +84,7 @@ export const getEmails = async () => { isComplete: Boolean(false), priority: "Low", fromImap: Boolean(true), - detail: html, + detail: html ? html : textAsHtml, }, }); From 02766a4c71f16dc044a7c66689d20b3757672758 Mon Sep 17 00:00:00 2001 From: potts99 Date: Thu, 11 Apr 2024 00:02:20 +0100 Subject: [PATCH 2/2] version bump --- apps/client/layouts/newLayout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/client/layouts/newLayout.tsx b/apps/client/layouts/newLayout.tsx index 46906fc9b..f26d74418 100644 --- a/apps/client/layouts/newLayout.tsx +++ b/apps/client/layouts/newLayout.tsx @@ -952,7 +952,7 @@ export default function NewLayout({ children }: any) { {user.isAdmin && ( - Version 0.4.6 + Version 0.4.7 )}