Add In-Reply-To to Email Workflow Node (#18641)

Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
neo773
2026-03-22 21:19:08 +05:30
committed by GitHub
parent 7bde8a4dfa
commit 8ef32c4781
26 changed files with 259 additions and 27 deletions
@@ -89,6 +89,7 @@ export class DraftEmailTool implements Tool {
body: data.plainTextBody,
html: data.sanitizedHtmlBody,
attachments: data.attachments,
inReplyTo: data.inReplyTo,
},
data.connectedAccount,
);
@@ -214,7 +214,7 @@ export class EmailComposerService {
context: ToolExecutionContext,
): Promise<EmailComposerResult> {
const { workspaceId } = context;
const { subject, body, files } = parameters;
const { subject, body, files, inReplyTo } = parameters;
let { connectedAccountId } = parameters;
let recipients: { to: string[]; cc: string[]; bcc: string[] };
@@ -309,6 +309,7 @@ export class EmailComposerService {
sanitizedHtmlBody,
attachments,
connectedAccount: connectedAccountWithFreshTokens,
inReplyTo,
},
};
}
@@ -37,4 +37,10 @@ export const EmailToolInputZodSchema = z.object({
.describe('Array of file objects to attach to the email')
.optional()
.default([]),
inReplyTo: z
.string()
.describe(
'The RFC 2822 Message-ID of an existing email to reply to. When provided, the email is sent as a reply in the same thread.',
)
.optional(),
});
@@ -88,6 +88,7 @@ export class SendEmailTool implements Tool {
body: data.plainTextBody,
html: data.sanitizedHtmlBody,
attachments: data.attachments,
inReplyTo: data.inReplyTo,
},
data.connectedAccount,
);
@@ -9,4 +9,5 @@ export type ComposedEmail = {
sanitizedHtmlBody: string;
attachments: MessageAttachment[];
connectedAccount: ConnectedAccountWorkspaceEntity;
inReplyTo?: string;
};