From d176ba95d3622dec21ef4e137634837c503db747 Mon Sep 17 00:00:00 2001 From: Weiko Date: Tue, 23 Jan 2024 19:40:05 +0100 Subject: [PATCH] Store HTML message (#3594) * Store HTML message * remove console log * fix html label/description --- .../messaging/services/messaging-utils.service.ts | 3 ++- .../standard-objects/message.object-metadata.ts | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/twenty-server/src/workspace/messaging/services/messaging-utils.service.ts b/packages/twenty-server/src/workspace/messaging/services/messaging-utils.service.ts index 30d54e122e..ae00615c78 100644 --- a/packages/twenty-server/src/workspace/messaging/services/messaging-utils.service.ts +++ b/packages/twenty-server/src/workspace/messaging/services/messaging-utils.service.ts @@ -91,7 +91,7 @@ export class MessagingUtilsService { const receivedAt = new Date(parseInt(message.internalDate)); await manager.query( - `INSERT INTO ${dataSourceMetadata.schema}."message" ("id", "headerMessageId", "subject", "receivedAt", "direction", "messageThreadId", "body") VALUES ($1, $2, $3, $4, $5, $6, $7)`, + `INSERT INTO ${dataSourceMetadata.schema}."message" ("id", "headerMessageId", "subject", "receivedAt", "direction", "messageThreadId", "body", "html") VALUES ($1, $2, $3, $4, $5, $6, $7, $8)`, [ newMessageId, message.headerMessageId, @@ -100,6 +100,7 @@ export class MessagingUtilsService { messageDirection, messageThreadId, message.text, + message.html, ], ); diff --git a/packages/twenty-server/src/workspace/workspace-sync-metadata/standard-objects/message.object-metadata.ts b/packages/twenty-server/src/workspace/workspace-sync-metadata/standard-objects/message.object-metadata.ts index f1c65732e0..f46e825a80 100644 --- a/packages/twenty-server/src/workspace/workspace-sync-metadata/standard-objects/message.object-metadata.ts +++ b/packages/twenty-server/src/workspace/workspace-sync-metadata/standard-objects/message.object-metadata.ts @@ -70,6 +70,14 @@ export class MessageObjectMetadata extends BaseObjectMetadata { }) body: string; + @FieldMetadata({ + type: FieldMetadataType.TEXT, + label: 'Html', + description: 'Html', + icon: 'IconMessage', + }) + html: string; + @FieldMetadata({ type: FieldMetadataType.DATE_TIME, label: 'Received At',