Skip to content

Commit fe989cc

Browse files
authored
filering of email addresses (#1986)
1 parent 7441e3e commit fe989cc

File tree

1 file changed

+14
-0
lines changed
  • apps/server/src/thread-workflow-utils

1 file changed

+14
-0
lines changed

apps/server/src/thread-workflow-utils/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@ import { composeEmail } from '../trpc/routes/ai/compose';
33
import { type ParsedMessage } from '../types';
44
import { connection } from '../db/schema';
55

6+
const dontReplyTo = new Set([
7+
8+
9+
10+
11+
12+
13+
]);
14+
615
const shouldGenerateDraft = async (
716
thread: IGetThreadResponse,
817
foundConnection: typeof connection.$inferSelect,
@@ -38,6 +47,11 @@ const shouldGenerateDraft = async (
3847
return false;
3948
}
4049

50+
if (dontReplyTo.has(senderEmail)) {
51+
console.log('[SHOULD_GENERATE_DRAFT] Message is from a dont reply to email, skipping draft');
52+
return false;
53+
}
54+
4155
if (latestMessage.receivedOn) {
4256
const messageDate = new Date(latestMessage.receivedOn);
4357
const sevenDaysAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);

0 commit comments

Comments
 (0)