diff --git a/backend/src/services/extractors/engines/EmailMessage.ts b/backend/src/services/extractors/engines/EmailMessage.ts index 451c13d31..935ef6584 100644 --- a/backend/src/services/extractors/engines/EmailMessage.ts +++ b/backend/src/services/extractors/engines/EmailMessage.ts @@ -333,12 +333,14 @@ export default class EmailMessage { field: validContact.sourceField }); - // Eliminate unwanted contacts associated with tags listed in IGNORED_MESSAGE_TAGS - if ( - tags.some((t) => EmailMessage.IGNORED_MESSAGE_TAGS.includes(t.name)) - ) { - return; - } + // TODO: [BUG] Re-enable once refine process properly handles transactional tag + // Previously this filtered out contacts from transactional emails, but it caused + // transactional-tagged contacts to be missing from the refined table. + // if ( + // tags.some((t) => EmailMessage.IGNORED_MESSAGE_TAGS.includes(t.name)) + // ) { + // return; + // } if (tags.some((t) => t.reachable === REACHABILITY.DIRECT_PERSON)) { if ( diff --git a/backend/test/unit/emailMessage.test.ts b/backend/test/unit/emailMessage.test.ts index 50104234e..44c8393e8 100644 --- a/backend/test/unit/emailMessage.test.ts +++ b/backend/test/unit/emailMessage.test.ts @@ -350,6 +350,35 @@ describe('Email Message', () => { reachable: REACHABILITY.DIRECT_PERSON } ] + }, + { + person: { + name: 'test', + email: 'invalid@leadminer.io', + identifiers: ['invalid'], + source: 'miningSource@leadminer.io' + }, + pointOfContact: { + name: 'test', + to: false, + cc: false, + bcc: false, + body: false, + from: true, + replyTo: false + }, + tags: [ + { + name: 'transactional', + source: 'refined#message_header', + reachable: 3 + }, + { + name: 'no-reply', + source: 'refined#email_address', + reachable: 3 + } + ] } ]; const contacts = await message.getContacts();