From 3504cc5f238312b4ed3d894859841b300a8f8d56 Mon Sep 17 00:00:00 2001 From: Deathgiver Date: Tue, 9 Jun 2026 20:15:35 +0700 Subject: [PATCH] fix(flows): correct email template variable and add tiktok integration field - Replace {{page_name}} with {{page_user_name}} in email step default footer - Add tiktok case to getIntegrationField for inbox name resolution - Add integrationTiktok to InboxWithIntegrations type --- packages/database/src/types.ts | 1 + packages/flow-config/src/steps/email.ts | 2 +- packages/variables/src/helpers/integration-fields.ts | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/database/src/types.ts b/packages/database/src/types.ts index fe83869992..7a8a41055d 100644 --- a/packages/database/src/types.ts +++ b/packages/database/src/types.ts @@ -114,6 +114,7 @@ export type InboxWithIntegrations = InboxModel & { integrationWhatsapp?: IntegrationWhatsappModel | null integrationZalo?: IntegrationZaloModel | null integrationSmtp?: IntegrationSmtpModel | null + integrationTiktok?: IntegrationTiktokModel | null } export type ContactOnSmartDelayModel = diff --git a/packages/flow-config/src/steps/email.ts b/packages/flow-config/src/steps/email.ts index ae1a283723..e0fe0dc48f 100644 --- a/packages/flow-config/src/steps/email.ts +++ b/packages/flow-config/src/steps/email.ts @@ -135,7 +135,7 @@ export const emailStepDefaultFn = ( { id: createId(), type: pageElementTypes.enum.text, - text: `You received this email from {{page_name}}. If you would like to unsubscribe, click here`, + text: `You received this email from {{page_user_name}}. If you would like to unsubscribe, click here`, }, ], ...props, diff --git a/packages/variables/src/helpers/integration-fields.ts b/packages/variables/src/helpers/integration-fields.ts index 59cc43db3c..370a0f0851 100644 --- a/packages/variables/src/helpers/integration-fields.ts +++ b/packages/variables/src/helpers/integration-fields.ts @@ -100,6 +100,8 @@ export const getIntegrationField = async ( return inbox.integrationWhatsapp?.name ?? null case channelTypes.enum.zalo: return inbox.integrationZalo?.name ?? null + case channelTypes.enum.tiktok: + return inbox.integrationTiktok?.name ?? null case channelTypes.enum.telegram: return inbox.integrationTelegram?.name ?? null case channelTypes.enum.webchat: