Skip to content

Commit

Permalink
fix email filter
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Feb 20, 2025
1 parent 85990e4 commit 4067b1b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/givebutter-salesforce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ const searchForSalesforceContact = (
] as const;
const clauses = [
soql`Givebutter_Contact_ID__c = ${givebutterContactId}`,
...emailCols.map(
(col) => `${col} IN (${emails.map(soqlQuote).join(",")})`,
),
...(emails.length > 0
? emailCols.map(
(col) => `${col} IN (${emails.map(soqlQuote).join(",")})`,
)
: []),
...(parsedName && parsedName.last && parsedName.first
? [
soql`(FirstName LIKE ${parsedName.first + "%"} AND LastName = ${
Expand Down

0 comments on commit 4067b1b

Please sign in to comment.