Skip to content

Commit

Permalink
4501 improve filters for emails imports (#4966)
Browse files Browse the repository at this point in the history
- Reduce gmailSearchFilterNonPersonalEmails to the essential
- Filter out promotions, social media and forums emails
  • Loading branch information
bosiraphael authored Apr 15, 2024
1 parent 42e50cb commit 764a3eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export const gmailSearchFilterNonPersonalEmails =
'noreply|no-reply|do_not_reply|no.reply|accounts@|info@|admin@|contact@|hello@|support@|sales@|feedback@|service@|help@|mailer-daemon|notifications|digest|auto|apps|assign|comments|customer-success|enterprise|esign|express|forum|gc@|learn|mailer|marketing|messages|news|notification|payments|receipts|recrutement|security|service|support|team';
'*noreply@|*no-reply@|*do_not_reply@|*no.reply@|*info@|*contact@|*hello@|*support@|*feedback@|*service@|*help@';

export const gmailSearchFilterExcludeEmails = (emails: string[]): string => {
if (emails.length === 0) {
return `from:-(${gmailSearchFilterNonPersonalEmails}`;
return `from:-(${gmailSearchFilterNonPersonalEmails} -category:promotions -category:social -category:forums`;
}

return `(in:inbox from:-(${gmailSearchFilterNonPersonalEmails}|${emails.join(
'|',
)})|(in:sent to:-(${gmailSearchFilterNonPersonalEmails}|${emails.join(
'|',
)}))`;
)})) -category:promotions -category:social -category:forums`;
};

This file was deleted.

0 comments on commit 764a3eb

Please sign in to comment.