Refactor email composer (#21177)

# Introduction
Gate what connected account can be ingested in case of ai mcp user
workspace agnostic funnel to only the workspace shared connected account

Added a quick win intregration tests on seeded connected accounts ( that
wasn't covered but already protected fix impacts only the mcp )

Refactored the API slightly too

## Notice
This mean there's a breaking change in the product behavior
Whereas before a non user workspace related mcp interaction would might
have fallback on any private user connected account it will now only
search for workspace visible listed ones
This commit is contained in:
Paul Rastoin
2026-06-03 17:15:51 +02:00
committed by GitHub
parent 8c3a93871e
commit 164a5b1e8d
10 changed files with 736 additions and 84 deletions
@@ -69,7 +69,7 @@ export class SendEmailResolver {
files: input.files ?? [],
inReplyTo: input.inReplyTo,
},
{ workspaceId: workspace.id },
{ workspaceId: workspace.id, userWorkspaceId },
{ attachmentsFileFolder: FileFolder.EmailAttachment },
);