From 7872e2c4d30c869e74a582e3a544d4e0cf526f93 Mon Sep 17 00:00:00 2001 From: Eduardo Lelis Date: Fri, 10 Oct 2025 01:53:05 -0300 Subject: [PATCH 1/7] Add links to digest messages --- apps/web/app/api/resend/digest/route.ts | 23 ++++ apps/web/app/api/resend/digest/validation.ts | 1 + apps/web/utils/outlook/message.ts | 7 +- apps/web/utils/types.ts | 1 + apps/web/utils/url.test.ts | 130 +++++++++++++++++++ apps/web/utils/url.ts | 82 ++++++++---- 6 files changed, 213 insertions(+), 31 deletions(-) create mode 100644 apps/web/utils/url.test.ts diff --git a/apps/web/app/api/resend/digest/route.ts b/apps/web/app/api/resend/digest/route.ts index c2fea36135..81340340aa 100644 --- a/apps/web/app/api/resend/digest/route.ts +++ b/apps/web/app/api/resend/digest/route.ts @@ -18,6 +18,7 @@ import { extractNameFromEmail } from "../../../../utils/email"; import { RuleName } from "@/utils/rule/consts"; import { verifySignatureAppRouter } from "@upstash/qstash/nextjs"; import { camelCase } from "lodash"; +import { getEmailUrlForMessage } from "@/utils/url"; import { createEmailProvider } from "@/utils/email/provider"; import { sleep } from "@/utils/sleep"; @@ -129,9 +130,12 @@ async function sendEmail({ items: { select: { messageId: true, + threadId: true, content: true, action: { select: { + folderName: true, + folderId: true, executedRule: { select: { rule: { @@ -246,10 +250,29 @@ async function sendEmail({ storedDigestContentSchema.safeParse(parsedContent); if (contentResult.success) { + // For Microsoft messages, use the weblink from Graph API if available + // Otherwise fall back to constructed URL + let emailUrl: string; + if ( + emailAccount.account.provider === "microsoft" && + message?.weblink + ) { + emailUrl = message.weblink; + } else { + emailUrl = getEmailUrlForMessage( + item.messageId, + item.threadId, + emailAccount.account.provider, + emailAccount.email, + item.action?.folderName, + ); + } + acc[ruleNameKey].push({ content: contentResult.data.content, from: extractNameFromEmail(message?.headers?.from || ""), subject: message?.headers?.subject || "", + emailUrl, }); } else { logger.warn("Failed to validate digest content structure", { diff --git a/apps/web/app/api/resend/digest/validation.ts b/apps/web/app/api/resend/digest/validation.ts index 3b0063bb7a..fe1e7dd009 100644 --- a/apps/web/app/api/resend/digest/validation.ts +++ b/apps/web/app/api/resend/digest/validation.ts @@ -7,6 +7,7 @@ const digestItemSchema = z.object({ from: z.string(), subject: z.string(), content: z.string(), + emailUrl: z.string().optional(), }); const digestSchema = z.record(z.string(), z.array(digestItemSchema).optional()); diff --git a/apps/web/utils/outlook/message.ts b/apps/web/utils/outlook/message.ts index 9b7308f22d..44f18b4e68 100644 --- a/apps/web/utils/outlook/message.ts +++ b/apps/web/utils/outlook/message.ts @@ -202,7 +202,7 @@ export async function queryBatchMessages( .getClient() .api("/me/messages") .select( - "id,conversationId,conversationIndex,subject,bodyPreview,from,sender,toRecipients,receivedDateTime,isDraft,isRead,body,categories,parentFolderId", + "id,conversationId,conversationIndex,subject,bodyPreview,from,sender,toRecipients,receivedDateTime,isDraft,isRead,body,categories,parentFolderId,webLink", ) .top(maxResults); @@ -347,7 +347,7 @@ export async function queryMessagesWithFilters( .getClient() .api("/me/messages") .select( - "id,conversationId,conversationIndex,subject,bodyPreview,from,sender,toRecipients,receivedDateTime,isDraft,isRead,body,categories,parentFolderId", + "id,conversationId,conversationIndex,subject,bodyPreview,from,sender,toRecipients,receivedDateTime,isDraft,isRead,body,categories,parentFolderId,webLink", ) .top(maxResults); @@ -419,7 +419,7 @@ export async function getMessage( .getClient() .api(`/me/messages/${messageId}`) .select( - "id,conversationId,conversationIndex,subject,bodyPreview,from,sender,toRecipients,receivedDateTime,isDraft,isRead,body,categories,parentFolderId", + "id,conversationId,conversationIndex,subject,bodyPreview,from,sender,toRecipients,receivedDateTime,isDraft,isRead,body,categories,parentFolderId,webLink", ) .get(); @@ -487,5 +487,6 @@ export function convertMessage( historyId: "", inline: [], conversationIndex: message.conversationIndex, + weblink: message.webLink, }; } diff --git a/apps/web/utils/types.ts b/apps/web/utils/types.ts index ee3663ef69..dabf24e6ce 100644 --- a/apps/web/utils/types.ts +++ b/apps/web/utils/types.ts @@ -67,6 +67,7 @@ export interface ParsedMessage { date: string; conversationIndex?: string | null; internalDate?: string | null; + weblink?: string; } export interface Attachment { diff --git a/apps/web/utils/url.test.ts b/apps/web/utils/url.test.ts new file mode 100644 index 0000000000..48ba944854 --- /dev/null +++ b/apps/web/utils/url.test.ts @@ -0,0 +1,130 @@ +import { describe, it, expect } from "vitest"; +import { getEmailUrlForMessage } from "./url"; + +describe("URL Generation", () => { + const testMessageId = "18c1234567890abcdef"; + const testThreadId = + "AQQkADAwATZiZmYAZC02NgAyNC1mOGZmAC0wMAItMDAKABAAdO%2BkeNAzxk%2BrwljH9yJ17w%3D%3D"; + const testEmail = "test@example.com"; + + it("should generate Gmail URL for Google provider", () => { + const url = getEmailUrlForMessage( + testMessageId, + testThreadId, + "google", + testEmail, + ); + + expect(url).toBe( + `https://mail.google.com/mail/?authuser=${encodeURIComponent(testEmail)}#all/${testMessageId}`, + ); + }); + + it("should generate Outlook URL for Microsoft provider", () => { + const url = getEmailUrlForMessage( + testMessageId, + testThreadId, + "microsoft", + testEmail, + ); + + expect(url).toBe( + `https://outlook.live.com/mail/0/inbox/id/${testThreadId}`, + ); + }); + + it("should generate Outlook URL with folder information", () => { + const url = getEmailUrlForMessage( + testMessageId, + testThreadId, + "microsoft", + testEmail, + "archive", + ); + + expect(url).toBe( + `https://outlook.live.com/mail/0/archive/id/${testThreadId}`, + ); + }); + + it("should generate Outlook URL with junk folder", () => { + const url = getEmailUrlForMessage( + testMessageId, + testThreadId, + "microsoft", + testEmail, + "junkemail", + ); + + expect(url).toBe( + `https://outlook.live.com/mail/0/junkemail/id/${testThreadId}`, + ); + }); + + it("should fallback to Gmail URL for unknown provider", () => { + const url = getEmailUrlForMessage( + testMessageId, + testThreadId, + "unknown", + testEmail, + ); + + expect(url).toBe( + `https://mail.google.com/mail/?authuser=${encodeURIComponent(testEmail)}#all/${testMessageId}`, + ); + }); + + it("should generate different URLs for different providers", () => { + const gmailUrl = getEmailUrlForMessage( + testMessageId, + testThreadId, + "google", + testEmail, + ); + const outlookUrl = getEmailUrlForMessage( + testMessageId, + testThreadId, + "microsoft", + testEmail, + ); + + expect(gmailUrl).not.toBe(outlookUrl); + expect(gmailUrl).toContain("mail.google.com"); + expect(outlookUrl).toContain("outlook.live.com"); + }); + + it("should handle empty email address", () => { + const url = getEmailUrlForMessage( + testMessageId, + testThreadId, + "google", + "", + ); + + expect(url).toContain("mail.google.com"); + expect(url).toContain(testMessageId); + }); + + it("should encode special characters in email address", () => { + const url = getEmailUrlForMessage( + testMessageId, + testThreadId, + "google", + "test+tag@example.com", + ); + + expect(url).toContain("test%2Btag%40example.com"); + }); + + it("should default to inbox folder when folder name is undefined", () => { + const url = getEmailUrlForMessage( + testMessageId, + testThreadId, + "microsoft", + testEmail, + undefined, + ); + + expect(url).toContain("/inbox/id/"); + }); +}); diff --git a/apps/web/utils/url.ts b/apps/web/utils/url.ts index 26f77dd87e..bbc77d9275 100644 --- a/apps/web/utils/url.ts +++ b/apps/web/utils/url.ts @@ -1,5 +1,15 @@ -function getGmailBaseUrl(emailAddress?: string | null) { - return `https://mail.google.com/mail/u/${emailAddress || 0}`; +function getGmailBaseUrl(emailAddress?: string) { + if (emailAddress) { + return `https://mail.google.com/mail/u/?email=${encodeURIComponent(emailAddress)}`; + } + return "https://mail.google.com/mail/u/0"; +} + +function getGmailMessageUrl(messageId: string, emailAddress?: string) { + if (emailAddress) { + return `https://mail.google.com/mail/?authuser=${encodeURIComponent(emailAddress)}#all/${messageId}`; + } + return `https://mail.google.com/mail/u/0/#all/${messageId}`; } function getOutlookBaseUrl() { @@ -11,45 +21,65 @@ const PROVIDER_CONFIG: Record< { buildUrl: ( messageOrThreadId: string, - emailAddress?: string | null, + emailAddress?: string, + folderName?: string, ) => string; selectId: (messageId: string, threadId: string) => string; } > = { microsoft: { - buildUrl: (messageOrThreadId: string, _emailAddress?: string | null) => { - // Outlook URL format: https://outlook.live.com/mail/0/inbox/id/ENCODED_MESSAGE_ID - // The message ID needs to be URL-encoded for Outlook - const encodedMessageId = encodeURIComponent(messageOrThreadId); - return `${getOutlookBaseUrl()}/inbox/id/${encodedMessageId}`; + buildUrl: ( + messageOrThreadId: string, + _emailAddress?: string, + folderName?: string, + ) => { + // Working Outlook URL format discovered from real URLs: + // https://outlook.live.com/mail/0/{FOLDER}/id/{MESSAGE_ID} + // Examples: + // - https://outlook.live.com/mail/0/inbox/id/... + // - https://outlook.live.com/mail/0/archive/id/... + // - https://outlook.live.com/mail/0/junkemail/id/... + // NOTE: Don't encode the messageId - it's already URL-encoded from Outlook + const folder = folderName || "inbox"; // Default to inbox if no folder specified + return `${getOutlookBaseUrl()}/${folder}/id/${messageOrThreadId}`; }, selectId: (_messageId: string, threadId: string) => threadId, }, google: { - buildUrl: (messageOrThreadId: string, emailAddress?: string | null) => - `${getGmailBaseUrl(emailAddress)}/#all/${messageOrThreadId}`, + buildUrl: ( + messageOrThreadId: string, + emailAddress?: string, + _folderName?: string, + ) => getGmailMessageUrl(messageOrThreadId, emailAddress), selectId: (messageId: string, _threadId: string) => messageId, }, default: { - buildUrl: (messageOrThreadId: string, emailAddress?: string | null) => - `${getGmailBaseUrl(emailAddress)}/#all/${messageOrThreadId}`, - selectId: (_messageId: string, threadId: string) => threadId, + buildUrl: ( + messageOrThreadId: string, + emailAddress?: string, + _folderName?: string, + ) => getGmailMessageUrl(messageOrThreadId, emailAddress), + selectId: (messageId: string, _threadId: string) => messageId, }, } as const; function getProviderConfig( provider?: string, ): (typeof PROVIDER_CONFIG)[keyof typeof PROVIDER_CONFIG] { - return PROVIDER_CONFIG[provider ?? "default"]; + return ( + PROVIDER_CONFIG[provider as keyof typeof PROVIDER_CONFIG] ?? + PROVIDER_CONFIG.default + ); } export function getEmailUrl( messageOrThreadId: string, - emailAddress?: string | null, provider?: string, + emailAddress?: string, + folderName?: string, ): string { const config = getProviderConfig(provider); - return config.buildUrl(messageOrThreadId, emailAddress); + return config.buildUrl(messageOrThreadId, emailAddress, folderName); } /** @@ -60,33 +90,29 @@ export function getEmailUrl( export function getEmailUrlForMessage( messageId: string, threadId: string, - emailAddress?: string | null, provider?: string, + emailAddress?: string, + folderName?: string, ) { const config = getProviderConfig(provider); const idToUse = config?.selectId(messageId, threadId); - return getEmailUrl(idToUse, emailAddress, provider); + return getEmailUrl(idToUse, provider, emailAddress, folderName); } // Keep the old function name for backward compatibility -export function getGmailUrl( - messageOrThreadId: string, - emailAddress?: string | null, -) { - return getEmailUrl(messageOrThreadId, emailAddress, "google"); +export function getGmailUrl(messageOrThreadId: string, emailAddress?: string) { + return getEmailUrl(messageOrThreadId, "google", emailAddress); } -export function getGmailSearchUrl(from: string, emailAddress?: string | null) { +export function getGmailSearchUrl(from: string, emailAddress?: string) { return `${getGmailBaseUrl( emailAddress, )}/#advanced-search/from=${encodeURIComponent(from)}`; } export function getGmailBasicSearchUrl(emailAddress: string, query: string) { - return `${getGmailBaseUrl(emailAddress)}/#search/${encodeURIComponent( - query, - )}`; + return `${getGmailBaseUrl(emailAddress)}/#search/${encodeURIComponent(query)}`; } // export function getGmailCreateFilterUrl( @@ -99,6 +125,6 @@ export function getGmailBasicSearchUrl(emailAddress: string, query: string) { // )}/#create-filter/from=${encodeURIComponent(search)}`; // } -export function getGmailFilterSettingsUrl(emailAddress?: string | null) { +export function getGmailFilterSettingsUrl(emailAddress?: string) { return `${getGmailBaseUrl(emailAddress)}/#settings/filters`; } From 59265c579cb62ff3f46f1974864a460350b6a5ca Mon Sep 17 00:00:00 2001 From: Eduardo Lelis Date: Fri, 10 Oct 2025 01:53:37 -0300 Subject: [PATCH 2/7] Add links to digest messages --- packages/resend/emails/digest.tsx | 34 +++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/packages/resend/emails/digest.tsx b/packages/resend/emails/digest.tsx index 4231385407..fb15005b65 100644 --- a/packages/resend/emails/digest.tsx +++ b/packages/resend/emails/digest.tsx @@ -16,6 +16,7 @@ type DigestItem = { from: string; subject: string; content: string; + emailUrl?: string; }; const colorClasses = { @@ -180,8 +181,8 @@ export default function DigestEmail(props: DigestEmailProps) {
- {categoryData.items.map((item, index) => ( -
+ {categoryData.items.map((item, index) => { + const emailContent = (
{/* Email Header */}
@@ -199,13 +200,25 @@ export default function DigestEmail(props: DigestEmailProps) { {/* Email Content */} {renderEmailContent(item)}
+ ); + + return ( +
+ {item.emailUrl ? ( + + {emailContent} + + ) : ( + emailContent + )} - {/* Separator line - don't show after the last item */} - {index < categoryData.items.length - 1 && ( -
- )} -
- ))} + {/* Separator line - don't show after the last item */} + {index < categoryData.items.length - 1 && ( +
+ )} +
+ ); + })}
@@ -328,18 +341,21 @@ DigestEmail.PreviewProps = { subject: "🔥 Today's top business stories", content: "Apple unveils Vision Pro 2 with 40% lighter design and $2,499 price tag", + emailUrl: "https://mail.google.com/mail/u/0/#all/18c1234567890abcdef", }, { from: "The New York Times", subject: "Breaking News: Latest developments", content: "Fed signals potential rate cuts as inflation shows signs of cooling to 3.2%", + emailUrl: "https://mail.google.com/mail/u/0/#all/18d9876543210fedcba", }, { from: "Product Hunt Daily", subject: "🚀 Today's hottest tech products", content: "Claude Projects: Anthropic's new workspace for organizing AI conversations (847 upvotes)", + emailUrl: "https://mail.google.com/mail/u/0/#all/18e5555555555555555", }, { from: "TechCrunch", @@ -372,6 +388,7 @@ DigestEmail.PreviewProps = { from: "Amazon", subject: "Order #123-4567890-1234567", content: "Your order has been delivered to your doorstep.", + emailUrl: "https://www.getinboxzero.com/123/emails/amazon-order-123", }, { from: "Uber Eats", @@ -511,6 +528,7 @@ DigestEmail.PreviewProps = { from: "John Smith", subject: "Re: Project proposal feedback", content: "Received: Yesterday, 4:30 PM • Due: Today", + emailUrl: "https://www.getinboxzero.com/123/emails/john-smith-proposal", }, { from: "Client XYZ", From 67de9f8b8116483ba90b8b474a57b068fceacd67 Mon Sep 17 00:00:00 2001 From: Eduardo Lelis Date: Fri, 10 Oct 2025 11:54:36 -0300 Subject: [PATCH 3/7] Remove unused folder --- .../assistant/ExecutedRulesTable.tsx | 2 +- apps/web/app/api/resend/digest/route.ts | 3 -- apps/web/components/EmailMessageCell.tsx | 2 +- apps/web/utils/url.test.ts | 22 +++--------- apps/web/utils/url.ts | 36 ++++++------------- 5 files changed, 16 insertions(+), 49 deletions(-) diff --git a/apps/web/app/(app)/[emailAccountId]/assistant/ExecutedRulesTable.tsx b/apps/web/app/(app)/[emailAccountId]/assistant/ExecutedRulesTable.tsx index 946d66465a..0f0f5c55f4 100644 --- a/apps/web/app/(app)/[emailAccountId]/assistant/ExecutedRulesTable.tsx +++ b/apps/web/app/(app)/[emailAccountId]/assistant/ExecutedRulesTable.tsx @@ -186,7 +186,7 @@ function OpenInGmailButton({ return ( diff --git a/apps/web/app/api/resend/digest/route.ts b/apps/web/app/api/resend/digest/route.ts index 81340340aa..62bdd90228 100644 --- a/apps/web/app/api/resend/digest/route.ts +++ b/apps/web/app/api/resend/digest/route.ts @@ -134,8 +134,6 @@ async function sendEmail({ content: true, action: { select: { - folderName: true, - folderId: true, executedRule: { select: { rule: { @@ -264,7 +262,6 @@ async function sendEmail({ item.threadId, emailAccount.account.provider, emailAccount.email, - item.action?.folderName, ); } diff --git a/apps/web/components/EmailMessageCell.tsx b/apps/web/components/EmailMessageCell.tsx index f17b5fe7fd..932ddd4bc8 100644 --- a/apps/web/components/EmailMessageCell.tsx +++ b/apps/web/components/EmailMessageCell.tsx @@ -100,8 +100,8 @@ export function EmailMessageCell({ href={getEmailUrlForMessage( messageId, threadId, - userEmail, provider, + userEmail, )} target="_blank" > diff --git a/apps/web/utils/url.test.ts b/apps/web/utils/url.test.ts index 48ba944854..cc0366ef18 100644 --- a/apps/web/utils/url.test.ts +++ b/apps/web/utils/url.test.ts @@ -33,33 +33,20 @@ describe("URL Generation", () => { ); }); - it("should generate Outlook URL with folder information", () => { + it("should generate Outlook URL defaulting to inbox folder", () => { const url = getEmailUrlForMessage( testMessageId, testThreadId, "microsoft", testEmail, - "archive", ); expect(url).toBe( - `https://outlook.live.com/mail/0/archive/id/${testThreadId}`, + `https://outlook.live.com/mail/0/inbox/id/${testThreadId}`, ); }); - it("should generate Outlook URL with junk folder", () => { - const url = getEmailUrlForMessage( - testMessageId, - testThreadId, - "microsoft", - testEmail, - "junkemail", - ); - - expect(url).toBe( - `https://outlook.live.com/mail/0/junkemail/id/${testThreadId}`, - ); - }); + // No folder argument supported for Outlook anymore; always defaults to inbox it("should fallback to Gmail URL for unknown provider", () => { const url = getEmailUrlForMessage( @@ -116,13 +103,12 @@ describe("URL Generation", () => { expect(url).toContain("test%2Btag%40example.com"); }); - it("should default to inbox folder when folder name is undefined", () => { + it("should default to inbox for Outlook when no folder is provided", () => { const url = getEmailUrlForMessage( testMessageId, testThreadId, "microsoft", testEmail, - undefined, ); expect(url).toContain("/inbox/id/"); diff --git a/apps/web/utils/url.ts b/apps/web/utils/url.ts index bbc77d9275..b9e2aa0e6d 100644 --- a/apps/web/utils/url.ts +++ b/apps/web/utils/url.ts @@ -19,20 +19,12 @@ function getOutlookBaseUrl() { const PROVIDER_CONFIG: Record< string, { - buildUrl: ( - messageOrThreadId: string, - emailAddress?: string, - folderName?: string, - ) => string; + buildUrl: (messageOrThreadId: string, emailAddress?: string) => string; selectId: (messageId: string, threadId: string) => string; } > = { microsoft: { - buildUrl: ( - messageOrThreadId: string, - _emailAddress?: string, - folderName?: string, - ) => { + buildUrl: (messageOrThreadId: string, _emailAddress?: string) => { // Working Outlook URL format discovered from real URLs: // https://outlook.live.com/mail/0/{FOLDER}/id/{MESSAGE_ID} // Examples: @@ -40,25 +32,19 @@ const PROVIDER_CONFIG: Record< // - https://outlook.live.com/mail/0/archive/id/... // - https://outlook.live.com/mail/0/junkemail/id/... // NOTE: Don't encode the messageId - it's already URL-encoded from Outlook - const folder = folderName || "inbox"; // Default to inbox if no folder specified - return `${getOutlookBaseUrl()}/${folder}/id/${messageOrThreadId}`; + // We do not rely on folder names; default to inbox for fallback links + return `${getOutlookBaseUrl()}/inbox/id/${messageOrThreadId}`; }, selectId: (_messageId: string, threadId: string) => threadId, }, google: { - buildUrl: ( - messageOrThreadId: string, - emailAddress?: string, - _folderName?: string, - ) => getGmailMessageUrl(messageOrThreadId, emailAddress), + buildUrl: (messageOrThreadId: string, emailAddress?: string) => + getGmailMessageUrl(messageOrThreadId, emailAddress), selectId: (messageId: string, _threadId: string) => messageId, }, default: { - buildUrl: ( - messageOrThreadId: string, - emailAddress?: string, - _folderName?: string, - ) => getGmailMessageUrl(messageOrThreadId, emailAddress), + buildUrl: (messageOrThreadId: string, emailAddress?: string) => + getGmailMessageUrl(messageOrThreadId, emailAddress), selectId: (messageId: string, _threadId: string) => messageId, }, } as const; @@ -76,10 +62,9 @@ export function getEmailUrl( messageOrThreadId: string, provider?: string, emailAddress?: string, - folderName?: string, ): string { const config = getProviderConfig(provider); - return config.buildUrl(messageOrThreadId, emailAddress, folderName); + return config.buildUrl(messageOrThreadId, emailAddress); } /** @@ -92,12 +77,11 @@ export function getEmailUrlForMessage( threadId: string, provider?: string, emailAddress?: string, - folderName?: string, ) { const config = getProviderConfig(provider); const idToUse = config?.selectId(messageId, threadId); - return getEmailUrl(idToUse, provider, emailAddress, folderName); + return getEmailUrl(idToUse, provider, emailAddress); } // Keep the old function name for backward compatibility From 2d8954ef892737b5db0d6f06ae4d69ccd99a979d Mon Sep 17 00:00:00 2001 From: Eduardo Lelis Date: Fri, 10 Oct 2025 17:44:56 -0300 Subject: [PATCH 4/7] Remove unused folder param --- .../assistant/ExecutedRulesTable.tsx | 29 ++---- .../[emailAccountId]/assistant/History.tsx | 6 +- .../assistant/ProcessRules.tsx | 10 +- .../cold-email-blocker/TestRules.tsx | 10 +- .../reply-zero/ReplyTrackerEmails.tsx | 11 +-- apps/web/app/api/resend/digest/route.ts | 21 +---- apps/web/components/EmailMessageCell.tsx | 70 +++++++------- apps/web/utils/url.test.ts | 91 +++++++++++++------ apps/web/utils/url.ts | 19 ++-- 9 files changed, 123 insertions(+), 144 deletions(-) diff --git a/apps/web/app/(app)/[emailAccountId]/assistant/ExecutedRulesTable.tsx b/apps/web/app/(app)/[emailAccountId]/assistant/ExecutedRulesTable.tsx index 0f0f5c55f4..0a7d2324c9 100644 --- a/apps/web/app/(app)/[emailAccountId]/assistant/ExecutedRulesTable.tsx +++ b/apps/web/app/(app)/[emailAccountId]/assistant/ExecutedRulesTable.tsx @@ -20,22 +20,17 @@ import { isGoogleProvider } from "@/utils/email/provider-types"; import { useRuleDialog } from "@/app/(app)/[emailAccountId]/assistant/RuleDialog"; export function EmailCell({ - from, - subject, - snippet, - threadId, - messageId, + message, userEmail, createdAt, }: { - from: string; - subject: string; - snippet: string; - threadId: string; - messageId: string; + message: ParsedMessage; userEmail: string; createdAt: Date; }) { + const { id: messageId, threadId, headers, snippet } = message; + const from = headers?.from || ""; + const subject = headers?.subject || ""; return (
@@ -44,11 +39,7 @@ export function EmailCell({
{subject} - + diff --git a/apps/web/app/(app)/[emailAccountId]/assistant/History.tsx b/apps/web/app/(app)/[emailAccountId]/assistant/History.tsx index f3124576ee..e793fcc741 100644 --- a/apps/web/app/(app)/[emailAccountId]/assistant/History.tsx +++ b/apps/web/app/(app)/[emailAccountId]/assistant/History.tsx @@ -82,11 +82,7 @@ function HistoryTable({ diff --git a/apps/web/app/(app)/[emailAccountId]/assistant/ProcessRules.tsx b/apps/web/app/(app)/[emailAccountId]/assistant/ProcessRules.tsx index da35f02dee..a9a9fc53cd 100644 --- a/apps/web/app/(app)/[emailAccountId]/assistant/ProcessRules.tsx +++ b/apps/web/app/(app)/[emailAccountId]/assistant/ProcessRules.tsx @@ -353,15 +353,7 @@ function ProcessRulesRow({ >
- +
{result ? ( <> diff --git a/apps/web/app/(app)/[emailAccountId]/cold-email-blocker/TestRules.tsx b/apps/web/app/(app)/[emailAccountId]/cold-email-blocker/TestRules.tsx index d0841961f1..864753ddb9 100644 --- a/apps/web/app/(app)/[emailAccountId]/cold-email-blocker/TestRules.tsx +++ b/apps/web/app/(app)/[emailAccountId]/cold-email-blocker/TestRules.tsx @@ -150,15 +150,7 @@ function TestRulesContentRow({ >
- +