feat(messaging): add workspace toggle to sync internal emails (#20457)

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
neo773
2026-05-12 01:12:51 +05:30
committed by GitHub
parent 75c22a2119
commit b03f044d0f
27 changed files with 235 additions and 12 deletions
@@ -1,4 +1,5 @@
import { type BlocklistItem } from '@/accounts/types/BlocklistItem';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { CoreObjectNameSingular } from 'twenty-shared/types';
@@ -16,9 +17,13 @@ export const SettingsAccountsBlocklistSection = () => {
const { t } = useLingui();
const currentWorkspaceMember = useAtomStateValue(currentWorkspaceMemberState);
const currentWorkspace = useAtomStateValue(currentWorkspaceState);
const currentWorkspaceMemberId = currentWorkspaceMember?.id ?? '';
const isInternalMessagesImportEnabled =
currentWorkspace?.isInternalMessagesImportEnabled ?? false;
const { records: blocklist } = useFindManyRecords<BlocklistItem>({
objectNameSingular: CoreObjectNameSingular.Blocklist,
filter: {
@@ -53,7 +58,11 @@ export const SettingsAccountsBlocklistSection = () => {
<Section>
<H2Title
title={t`Blocklist`}
description={t`Exclude the following people and domains from my email sync. Internal conversations will not be imported`}
description={
isInternalMessagesImportEnabled
? t`Exclude the following people and domains from my email sync.`
: t`Exclude the following people and domains from my email sync. Internal conversations will not be imported`
}
/>
<SettingsAccountsBlocklistInput
blockedEmailOrDomainList={blocklist.map((item) => item.handle)}