Skip to content

Commit 68af663

Browse files
fix(enrichment): only accept valid-qualified Enrow emails in work-email
Enrow's finder qualifies each email valid/invalid. The work-email mapOutput accepted any non-empty email, so an invalid-qualified address could fill the cell while hosted billing (which only charges on valid) charged zero. Gate the cell on qualification === 'valid', consistent with billing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 3a6782b commit 68af663

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

apps/sim/enrichments/work-email/work-email.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ describe('work-email enrichment cascade', () => {
158158
company_domain: 'acme.com',
159159
})
160160
expect(p.buildParams({ fullName: 'John Doe' })).toBeNull()
161-
expect(p.mapOutput({ email: 'j@acme.com' })).toEqual({ email: 'j@acme.com' })
161+
// only a valid-qualified email fills the cell
162+
expect(p.mapOutput({ email: 'j@acme.com', qualification: 'valid' })).toEqual({
163+
email: 'j@acme.com',
164+
})
165+
expect(p.mapOutput({ email: 'j@acme.com', qualification: 'invalid' })).toBeNull()
166+
expect(p.mapOutput({ email: 'j@acme.com' })).toBeNull()
162167
expect(p.mapOutput({})).toBeNull()
163168
})
164169
})

apps/sim/enrichments/work-email/work-email.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,12 @@ export const workEmailEnrichment: EnrichmentConfig = {
217217
return { fullname, company_domain }
218218
},
219219
mapOutput: (output) => {
220+
// Enrow qualifies each found email valid/invalid; only accept verified-valid
221+
// results so the cell isn't filled with an address Enrow itself rejected
222+
// (and which hosted billing correctly charges zero for).
220223
const email = str(output.email)
221-
return email ? { email } : null
224+
const qualification = str(output.qualification).toLowerCase()
225+
return email && qualification === 'valid' ? { email } : null
222226
},
223227
}),
224228
],

0 commit comments

Comments
 (0)