File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
apps/server/src/thread-workflow-utils Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,15 @@ import { composeEmail } from '../trpc/routes/ai/compose';
33import { type ParsedMessage } from '../types' ;
44import { connection } from '../db/schema' ;
55
6+ const dontReplyTo = new Set ( [
7+ 'no-reply@gmail.com' ,
8+ 'noreply@gmail.com' ,
9+ 'do-not-reply@gmail.com' ,
10+ 'do-not-reply@gmail.com' ,
11+ 'notifications@github.com' ,
12+ 'info@e-mail.xing.com' ,
13+ ] ) ;
14+
615const 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 ) ;
You can’t perform that action at this time.
0 commit comments