Send Email Tool: Don't persist message on SMTP only connections (#19756)

Previously this blocked users who only had SMTP configured to send
outbound emails, this fixes it by making messageChannel and persist
layer conditional
This commit is contained in:
neo773
2026-04-17 18:26:38 +05:30
committed by GitHub
parent 4ed6fcd19e
commit 68746e22a0
5 changed files with 67 additions and 31 deletions
@@ -79,11 +79,13 @@ export class SendEmailResolver {
const sendResult = await this.sendEmailService.sendComposedEmail(data);
await this.sendEmailService.persistSentMessage(
sendResult,
data,
workspace.id,
);
if (data.shouldPersistMessage) {
await this.sendEmailService.persistSentMessage(
sendResult,
data,
workspace.id,
);
}
const attachmentFileIds = (input.files ?? []).map((file) => file.id);
@@ -43,7 +43,7 @@ export class SendEmailService {
body: data.plainTextBody,
recipients: data.recipients,
connectedAccount: data.connectedAccount,
messageChannelId: data.messageChannelId,
messageChannelId: data.messageChannelId!,
inReplyTo: data.inReplyTo,
workspaceId,
});