diff --git a/packages/twenty-server/src/workspace/messaging/repositories/message/message.service.ts b/packages/twenty-server/src/workspace/messaging/repositories/message/message.service.ts index 0d81c11d95..e3454366ac 100644 --- a/packages/twenty-server/src/workspace/messaging/repositories/message/message.service.ts +++ b/packages/twenty-server/src/workspace/messaging/repositories/message/message.service.ts @@ -212,7 +212,7 @@ export class MessageService { const receivedAt = new Date(parseInt(message.internalDate)); await manager.query( - `INSERT INTO ${dataSourceMetadata.schema}."message" ("id", "headerMessageId", "subject", "receivedAt", "direction", "messageThreadId", "text", "html") VALUES ($1, $2, $3, $4, $5, $6, $7, $8)`, + `INSERT INTO ${dataSourceMetadata.schema}."message" ("id", "headerMessageId", "subject", "receivedAt", "direction", "messageThreadId", "text") VALUES ($1, $2, $3, $4, $5, $6, $7)`, [ newMessageId, message.headerMessageId, @@ -221,7 +221,6 @@ export class MessageService { messageDirection, messageThreadId, message.text, - message.html, ], ); diff --git a/packages/twenty-server/src/workspace/messaging/services/fetch-messages-by-batches.service.ts b/packages/twenty-server/src/workspace/messaging/services/fetch-messages-by-batches.service.ts index 7684654ad6..bde65dc2a1 100644 --- a/packages/twenty-server/src/workspace/messaging/services/fetch-messages-by-batches.service.ts +++ b/packages/twenty-server/src/workspace/messaging/services/fetch-messages-by-batches.service.ts @@ -199,19 +199,15 @@ export class FetchMessagesByBatchesService { const body = atob(raw?.replace(/-/g, '+').replace(/_/g, '/')); try { - const parsed = await simpleParser(body); + const parsed = await simpleParser(body, { + skipHtmlToText: true, + skipImageLinks: true, + skipTextToHtml: true, + maxHtmlLengthToParse: 0, + }); - const { - subject, - messageId, - from, - to, - cc, - bcc, - text, - html, - attachments, - } = parsed; + const { subject, messageId, from, to, cc, bcc, text, attachments } = + parsed; if (!from) throw new Error('From value is missing'); @@ -248,7 +244,6 @@ export class FetchMessagesByBatchesService { fromDisplayName: from.value[0].name || '', participants, text: textWithoutReplyQuotations || '', - html: html || '', attachments, }; diff --git a/packages/twenty-server/src/workspace/messaging/types/gmail-message.ts b/packages/twenty-server/src/workspace/messaging/types/gmail-message.ts index 8976ab033f..fe9b693e05 100644 --- a/packages/twenty-server/src/workspace/messaging/types/gmail-message.ts +++ b/packages/twenty-server/src/workspace/messaging/types/gmail-message.ts @@ -11,7 +11,6 @@ export type GmailMessage = { fromDisplayName: string; participants: Participant[]; text: string; - html: string; attachments: Attachment[]; }; 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 c8dec5287a..0d2e337990 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 @@ -69,14 +69,6 @@ export class MessageObjectMetadata extends BaseObjectMetadata { }) text: string; - @FieldMetadata({ - type: FieldMetadataType.TEXT, - label: 'Html', - description: 'Html', - icon: 'IconMessage', - }) - html: string; - @FieldMetadata({ type: FieldMetadataType.DATE_TIME, label: 'Received At',