Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions backend/src/services/extractors/engines/EmailMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
29 changes: 29 additions & 0 deletions backend/test/unit/emailMessage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Loading