Skip to content

The open alternative to Salesforce, designed for AI.

[WIP] Feat/marketing emails (#21173)

neo7735d892bdfd0b1
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index d6fc69b75b1..bfa707a351d 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -400,6 +400,7 @@ enum EngineComponentKey {
FRONT_COMPONENT_RENDERER
REPLY_TO_EMAIL_THREAD
COMPOSE_EMAIL
+ COMPOSE_CAMPAIGN
GO_TO_PEOPLE
GO_TO_COMPANIES
GO_TO_DASHBOARDS
@@ -1440,34 +1441,6 @@ type EnterpriseSubscriptionStatusDTO {
isCancellationScheduled: Boolean!
}
-type VerificationRecord {
- type: String!
- key: String!
- value: String!
- priority: Float
-}
-
-type EmailingDomain {
- id: UUID!
- createdAt: DateTime!
- updatedAt: DateTime!
- domain: String!
- status: EmailingDomainStatus!
- verificationRecords: [VerificationRecord!]
- verifiedAt: DateTime
-}
-
-enum EmailingDomainStatus {
- PENDING
- VERIFIED
- FAILED
- TEMPORARY_FAILURE
-}
-
-type SendEmailViaDomainOutput {
- messageId: String!
-}
-
type ApprovedAccessDomain {
id: UUID!
domain: String!
@@ -1964,7 +1937,7 @@ type ClientConfig {
isGoogleCalendarEnabled: Boolean!
isConfigVariablesInDbEnabled: Boolean!
isImapSmtpCaldavEnabled: Boolean!
- isEmailGroupEnabled: Boolean!
+ isEmailingDomainInDemoMode: Boolean!
allowRequestsToTwentyIcons: Boolean!
calendarBookingPageId: String
isCloudflareIntegrationEnabled: Boolean!
@@ -2442,6 +2415,146 @@ type PublicDomain {
createdAt: DateTime!
}
+type VerificationRecord {
+ type: String!
+ key: String!
+ value: String!
+ priority: Float
+}
+
+type EmailingDomain {
+ id: UUID!
+ createdAt: DateTime!
+ updatedAt: DateTime!
+ domain: String!
+ status: EmailingDomainStatus!
+ verificationRecords: [VerificationRecord!]
+ verifiedAt: DateTime
+}
+
+enum EmailingDomainStatus {
+ PENDING
+ VERIFIED
+ FAILED
+ TEMPORARY_FAILURE
+}
+
+type MessageChannel {
+ id: UUID!
+ visibility: MessageChannelVisibility!
+ handle: String!
+ type: MessageChannelType!
+ isContactAutoCreationEnabled: Boolean!
+ contactAutoCreationPolicy: MessageChannelContactAutoCreationPolicy!
+ messageFolderImportPolicy: MessageFolderImportPolicy!
+ excludeNonProfessionalEmails: Boolean!
+ excludeGroupEmails: Boolean!
+ pendingGroupEmailsAction: MessageChannelPendingGroupEmailsAction!
+ isSyncEnabled: Boolean!
+ syncedAt: DateTime
+ syncStatus: MessageChannelSyncStatus!
+ syncStage: MessageChannelSyncStage!
+ syncStageStartedAt: DateTime
+ throttleFailureCount: Float!
+ throttleRetryAfter: DateTime
+ connectedAccountId: UUID!
+ createdAt: DateTime!
+ updatedAt: DateTime!
+ connectedAccount: ConnectedAccountPublicDTO
+}
+
+enum MessageChannelVisibility {
+ METADATA
+ SUBJECT
+ SHARE_EVERYTHING
+}
+
+enum MessageChannelType {
+ EMAIL
+ SMS
+ EMAIL_GROUP
+}
+
+enum MessageChannelContactAutoCreationPolicy {
+ SENT_AND_RECEIVED
+ SENT
+ NONE
+}
+
+enum MessageFolderImportPolicy {
+ ALL_FOLDERS
+ SELECTED_FOLDERS
+}
+
+enum MessageChannelPendingGroupEmailsAction {
+ GROUP_EMAILS_DELETION
+ GROUP_EMAILS_IMPORT
+ NONE
+}
+
+enum MessageChannelSyncStatus {
+ NOT_SYNCED
+ ONGOING
+ ACTIVE
+ FAILED_INSUFFICIENT_PERMISSIONS
+ FAILED_UNKNOWN
+}
+
+enum MessageChannelSyncStage {
+ PENDING_CONFIGURATION
+ MESSAGE_LIST_FETCH_PENDING
+ MESSAGE_LIST_FETCH_SCHEDULED
+ MESSAGE_LIST_FETCH_ONGOING
+ MESSAGES_IMPORT_PENDING
+ MESSAGES_IMPORT_SCHEDULED
+ MESSAGES_IMPORT_ONGOING
+ FAILED
+}
+
+type CreateEmailGroupChannelOutput {
+ messageChannel: MessageChannel!
+ forwardingAddress: String!
+}
+
+type CampaignAudiencePreviewDTO {
+ totalMembers: Int!
+ withoutEmail: Int!
+ duplicateEmails: Int!
+ globallyUnsubscribed: Int!
+ topicUnsubscribed: Int!
+ sendable: Int!
+}
+
+type SendEmailViaDomainOutput {
+ messageId: String!
+}
+
+type CampaignSkippedRecipientsDTO {
+ noEmail: Int!
+ deduped: Int!
+ overCap: Int!
+}
+
+type SendMessageCampaignOutputDTO {
+ campaignId: String!
+ queuedCount: Int!
+ skipped: CampaignSkippedRecipientsDTO!
+}
+
+type UnsubscribeTopic {
+ id: UUID!
+ createdAt: DateTime!
+ updatedAt: DateTime!
+ name: String
+ description: String
+ visibility: UnsubscribeTopicVisibility!
+}
+
+enum UnsubscribeTopicVisibility {
+ PUBLIC
+ PRIVATE
+}
+
type AutocompleteResult {
text: String!
placeId: String!
@@ -2782,83 +2895,6 @@ enum CalendarChannelContactAutoCreationPolicy {
NONE
}
-type MessageChannel {
- id: UUID!
- visibility: MessageChannelVisibility!
- handle: String!
- type: MessageChannelType!
- isContactAutoCreationEnabled: Boolean!
- contactAutoCreationPolicy: MessageChannelContactAutoCreationPolicy!
- messageFolderImportPolicy: MessageFolderImportPolicy!
- excludeNonProfessionalEmails: Boolean!
- excludeGroupEmails: Boolean!
- pendingGroupEmailsAction: MessageChannelPendingGroupEmailsAction!
- isSyncEnabled: Boolean!
- syncedAt: DateTime
- syncStatus: MessageChannelSyncStatus!
- syncStage: MessageChannelSyncStage!
- syncStageStartedAt: DateTime
- throttleFailureCount: Float!
- throttleRetryAfter: DateTime
- connectedAccountId: UUID!
- createdAt: DateTime!
- updatedAt: DateTime!
- connectedAccount: ConnectedAccountPublicDTO
-}
-
-enum MessageChannelVisibility {
- METADATA
- SUBJECT
- SHARE_EVERYTHING
-}
-
-enum MessageChannelType {
- EMAIL
- SMS
- EMAIL_GROUP
-}
-
-enum MessageChannelContactAutoCreationPolicy {
- SENT_AND_RECEIVED
- SENT
- NONE
-}
-
-enum MessageFolderImportPolicy {
- ALL_FOLDERS
- SELECTED_FOLDERS
-}
-
-enum MessageChannelPendingGroupEmailsAction {
- GROUP_EMAILS_DELETION
- GROUP_EMAILS_IMPORT
- NONE
-}
-
-enum MessageChannelSyncStatus {
- NOT_SYNCED
- ONGOING
- ACTIVE
- FAILED_INSUFFICIENT_PERMISSIONS
- FAILED_UNKNOWN
-}
-
-enum MessageChannelSyncStage {
- PENDING_CONFIGURATION
- MESSAGE_LIST_FETCH_PENDING
- MESSAGE_LIST_FETCH_SCHEDULED
- MESSAGE_LIST_FETCH_ONGOING
- MESSAGES_IMPORT_PENDING
- MESSAGES_IMPORT_SCHEDULED
- MESSAGES_IMPORT_ONGOING
- FAILED
-}
-
-type CreateEmailGroupChannelOutput {
- messageChannel: MessageChannel!
- forwardingAddress: String!
-}
-
type MessageFolder {
id: UUID!
name: String
@@ -2971,7 +3007,6 @@ type Query {
getPageLayoutTab(id: String!): PageLayoutTab!
getPageLayouts(objectMetadataId: String, pageLayoutType: PageLayoutType): [PageLayout!]!
getPageLayout(id: String!): PageLayout
- getEmailingDomains: [EmailingDomain!]!
applicationConnectionProviders(applicationId: UUID!): [ApplicationConnectionProvider!]!
getPageLayoutWidgets(pageLayoutTabId: String!): [PageLayoutWidget!]!
getPageLayoutWidget(id: String!): PageLayoutWidget!
@@ -3008,6 +3043,12 @@ type Query {
): IndexConnection!
findManyAgents: [Agent!]!
findOneAgent(input: AgentIdInput!): Agent!
+ previewMessageCampaignAudience(input: PreviewMessageCampaignAudienceInput!): CampaignAudiencePreviewDTO!
+ unsubscribeTopics: [UnsubscribeTopic!]!
+ unsubscribePagePreviewUrl: String!
+ myMessageChannels(connectedAccountId: UUID): [MessageChannel!]!
+ getEmailingDomains: [EmailingDomain!]!
+ myConnectedAccounts: [ConnectedAccountPublicDTO!]!
getRoles: [Role!]!
getToolIndex: [ToolIndexEntry!]!
getToolInputSchema(toolName: String!): JSON
@@ -3027,8 +3068,6 @@ type Query {
getViewGroups(viewId: String): [ViewGroup!]!
getViewGroup(id: String!): ViewGroup
myMessageFolders(messageChannelId: UUID): [MessageFolder!]!
- myMessageChannels(connectedAccountId: UUID): [MessageChannel!]!
- myConnectedAccounts: [ConnectedAccountPublicDTO!]!
myCalendarChannels(connectedAccountId: UUID): [CalendarChannel!]!
minimalMetadata: MinimalMetadata!
appConnections(filter: ListAppConnectionsInput): [AppConnection!]!
@@ -3087,6 +3126,11 @@ input AgentIdInput {
id: UUID!
}
+input PreviewMessageCampaignAudienceInput {
+ listId: String!
+ unsubscribeTopicId: String
+}
+
input ListAppConnectionsInput {
providerName: String
userWorkspaceId: String
@@ -3227,10 +3271,6 @@ type Mutation {
resetPageLayoutToDefault(id: String!): PageLayout!
resetPageLayoutWidgetToDefault(id: String!): PageLayoutWidget!
resetPageLayoutTabToDefault(id: String!): PageLayoutTab!
- createEmailingDomain(domain: String!): EmailingDomain!
- deleteEmailingDomain(id: String!): Boolean!
- verifyEmailingDomain(id: String!): EmailingDomain!
- sendEmailViaEmailingDomain(input: SendEmailViaDomainInput!): SendEmailViaDomainOutput!
updateOneApplicationVariable(key: String!, value: String!, applicationId: UUID!): Boolean!
createPageLayoutWidget(input: CreatePageLayoutWidgetInput!): PageLayoutWidget!
updatePageLayoutWidget(id: String!, input: UpdatePageLayoutWidgetInput!): PageLayoutWidget!
@@ -3253,6 +3293,18 @@ type Mutation {
createOneAgent(input: CreateAgentInput!): Agent!
updateOneAgent(input: UpdateAgentInput!): Agent!
deleteOneAgent(input: AgentIdInput!): Agent!
+ sendEmailViaEmailingDomain(input: SendEmailViaDomainInput!): SendEmailViaDomainOutput!
+ sendMessageCampaign(input: SendMessageCampaignInput!): SendMessageCampaignOutputDTO!
+ createUnsubscribeTopic(input: CreateUnsubscribeTopicInput!): UnsubscribeTopic!
+ updateUnsubscribeTopic(input: UpdateUnsubscribeTopicInput!): UnsubscribeTopic!
+ deleteUnsubscribeTopic(id: String!): Boolean!
+ updateMessageChannel(input: UpdateMessageChannelInput!): MessageChannel!
+ createEmailGroupChannel(input: CreateEmailGroupChannelInput!): CreateEmailGroupChannelOutput!
+ deleteEmailGroupChannel(id: UUID!): MessageChannel!
+ createEmailingDomain(input: CreateEmailingDomainInput!): EmailingDomain!
+ deleteEmailingDomain(id: String!): Boolean!
+ verifyEmailingDomain(id: String!): EmailingDomain!
+ deleteConnectedAccount(id: UUID!): ConnectedAccountPublicDTO!
updateWorkspaceMemberRole(workspaceMemberId: UUID!, roleId: UUID!): WorkspaceMember!
createOneRole(createRoleInput: CreateRoleInput!): Role!
updateOneRole(updateRoleInput: UpdateRoleInput!): Role!
@@ -3278,10 +3330,6 @@ type Mutation {
destroyViewGroup(input: DestroyViewGroupInput!): ViewGroup!
updateMessageFolder(input: UpdateMessageFolderInput!): MessageFolder!
updateMessageFolders(input: UpdateMessageFoldersInput!): [MessageFolder!]!
- updateMessageChannel(input: UpdateMessageChannelInput!): MessageChannel!
- createEmailGroupChannel(input: CreateEmailGroupChannelInput!): CreateEmailGroupChannelOutput!
- deleteEmailGroupChannel(id: UUID!): MessageChannel!
- deleteConnectedAccount(id: UUID!): ConnectedAccountPublicDTO!
updateCalendarChannel(input: UpdateCalendarChannelInput!): CalendarChannel!
createChatThread: AgentChatThread!
sendChatMessage(threadId: UUID!, text: String!, messageId: UUID!, browsingContext: JSON, modelId: String, fileAttachments: [FileAttachmentInput!]): SendChatMessageResult!
@@ -3793,18 +3841,6 @@ input GridPositionInput {
columnSpan: Float!
}
-input SendEmailViaDomainInput {
- emailingDomainId: String!
- to: [String!]!
- cc: [String!]
- bcc: [String!]
- subject: String!
- text: String!
- html: String
- from: String!
- replyTo: [String!]
-}
-
input CreatePageLayoutWidgetInput {
pageLayoutTabId: UUID!
title: String!
@@ -4022,6 +4058,62 @@ input UpdateAgentInput {
evaluationInputs: [String!]
}
+input SendEmailViaDomainInput {
+ emailingDomainId: String!
+ to: [String!]!
+ cc: [String!]
+ bcc: [String!]
+ subject: String!
+ text: String!
+ html: String
+ from: String!
+ replyTo: [String!]
+}
+
+input SendMessageCampaignInput {
+ listId: String!
+ unsubscribeTopicId: String
+ subject: String!
+ body: String!
+ fromAddress: String!
+}
+
+input CreateUnsubscribeTopicInput {
+ name: String!
+ description: String
+ visibility: UnsubscribeTopicVisibility
+}
+
+input UpdateUnsubscribeTopicInput {
+ id: String!
+ name: String
+ description: String
+ visibility: UnsubscribeTopicVisibility
+}
+
+input UpdateMessageChannelInput {
+ id: UUID!
+ update: UpdateMessageChannelInputUpdates!
+}
+
+input UpdateMessageChannelInputUpdates {
+ visibility: MessageChannelVisibility
+ isContactAutoCreationEnabled: Boolean
+ contactAutoCreationPolicy: MessageChannelContactAutoCreationPolicy
+ messageFolderImportPolicy: MessageFolderImportPolicy
+ isSyncEnabled: Boolean
+ excludeNonProfessionalEmails: Boolean
+ excludeGroupEmails: Boolean
+}
+
+input CreateEmailGroupChannelInput {
+ handle: String!
+}
+
+input CreateEmailingDomainInput {
+ domain: String!
+}
+
input CreateRoleInput {
id: String
label: String!
@@ -4253,25 +4345,6 @@ input UpdateMessageFoldersInput {
update: UpdateMessageFolderInputUpdates!
}
-input UpdateMessageChannelInput {
- id: UUID!
- update: UpdateMessageChannelInputUpdates!
-}
-
-input UpdateMessageChannelInputUpdates {
- visibility: MessageChannelVisibility
- isContactAutoCreationEnabled: Boolean
- contactAutoCreationPolicy: MessageChannelContactAutoCreationPolicy
- messageFolderImportPolicy: MessageFolderImportPolicy
- isSyncEnabled: Boolean
- excludeNonProfessionalEmails: Boolean
- excludeGroupEmails: Boolean
-}
-
-input CreateEmailGroupChannelInput {
- handle: String!
-}
-
input UpdateCalendarChannelInput {
id: UUID!
update: UpdateCalendarChannelInputUpdates!
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index 7fafbd8ffc4..f67cc693222 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -305,7 +305,7 @@ export interface CommandMenuItem {
__typename: 'CommandMenuItem'
}
-export type EngineComponentKey = 'NAVIGATE_TO_NEXT_RECORD' | 'NAVIGATE_TO_PREVIOUS_RECORD' | 'CREATE_NEW_RECORD' | 'DELETE_RECORDS' | 'RESTORE_RECORDS' | 'DESTROY_RECORDS' | 'ADD_TO_FAVORITES' | 'REMOVE_FROM_FAVORITES' | 'EXPORT_NOTE_TO_PDF' | 'EXPORT_RECORDS' | 'UPDATE_MULTIPLE_RECORDS' | 'MERGE_MULTIPLE_RECORDS' | 'IMPORT_RECORDS' | 'EXPORT_VIEW' | 'SEE_DELETED_RECORDS' | 'CREATE_NEW_VIEW' | 'HIDE_DELETED_RECORDS' | 'EDIT_RECORD_PAGE_LAYOUT' | 'EDIT_DASHBOARD_LAYOUT' | 'SAVE_DASHBOARD_LAYOUT' | 'CANCEL_DASHBOARD_LAYOUT' | 'DUPLICATE_DASHBOARD' | 'ACTIVATE_WORKFLOW' | 'DEACTIVATE_WORKFLOW' | 'DISCARD_DRAFT_WORKFLOW' | 'TEST_WORKFLOW' | 'SEE_ACTIVE_VERSION_WORKFLOW' | 'SEE_RUNS_WORKFLOW' | 'SEE_VERSIONS_WORKFLOW' | 'ADD_NODE_WORKFLOW' | 'TIDY_UP_WORKFLOW' | 'DUPLICATE_WORKFLOW' | 'SEE_VERSION_WORKFLOW_RUN' | 'SEE_WORKFLOW_WORKFLOW_RUN' | 'STOP_WORKFLOW_RUN' | 'RETRY_WORKFLOW_RUN' | 'SEE_RUNS_WORKFLOW_VERSION' | 'SEE_WORKFLOW_WORKFLOW_VERSION' | 'USE_AS_DRAFT_WORKFLOW_VERSION' | 'SEE_VERSIONS_WORKFLOW_VERSION' | 'SEARCH_RECORDS' | 'SEARCH_RECORDS_FALLBACK' | 'ASK_AI' | 'VIEW_PREVIOUS_AI_CHATS' | 'NAVIGATION' | 'TRIGGER_WORKFLOW_VERSION' | 'FRONT_COMPONENT_RENDERER' | 'REPLY_TO_EMAIL_THREAD' | 'COMPOSE_EMAIL' | 'GO_TO_PEOPLE' | 'GO_TO_COMPANIES' | 'GO_TO_DASHBOARDS' | 'GO_TO_OPPORTUNITIES' | 'GO_TO_SETTINGS' | 'GO_TO_TASKS' | 'GO_TO_NOTES' | 'GO_TO_WORKFLOWS' | 'GO_TO_RUNS' | 'DELETE_SINGLE_RECORD' | 'DELETE_MULTIPLE_RECORDS' | 'RESTORE_SINGLE_RECORD' | 'RESTORE_MULTIPLE_RECORDS' | 'DESTROY_SINGLE_RECORD' | 'DESTROY_MULTIPLE_RECORDS' | 'EXPORT_FROM_RECORD_INDEX' | 'EXPORT_FROM_RECORD_SHOW' | 'EXPORT_MULTIPLE_RECORDS'
+export type EngineComponentKey = 'NAVIGATE_TO_NEXT_RECORD' | 'NAVIGATE_TO_PREVIOUS_RECORD' | 'CREATE_NEW_RECORD' | 'DELETE_RECORDS' | 'RESTORE_RECORDS' | 'DESTROY_RECORDS' | 'ADD_TO_FAVORITES' | 'REMOVE_FROM_FAVORITES' | 'EXPORT_NOTE_TO_PDF' | 'EXPORT_RECORDS' | 'UPDATE_MULTIPLE_RECORDS' | 'MERGE_MULTIPLE_RECORDS' | 'IMPORT_RECORDS' | 'EXPORT_VIEW' | 'SEE_DELETED_RECORDS' | 'CREATE_NEW_VIEW' | 'HIDE_DELETED_RECORDS' | 'EDIT_RECORD_PAGE_LAYOUT' | 'EDIT_DASHBOARD_LAYOUT' | 'SAVE_DASHBOARD_LAYOUT' | 'CANCEL_DASHBOARD_LAYOUT' | 'DUPLICATE_DASHBOARD' | 'ACTIVATE_WORKFLOW' | 'DEACTIVATE_WORKFLOW' | 'DISCARD_DRAFT_WORKFLOW' | 'TEST_WORKFLOW' | 'SEE_ACTIVE_VERSION_WORKFLOW' | 'SEE_RUNS_WORKFLOW' | 'SEE_VERSIONS_WORKFLOW' | 'ADD_NODE_WORKFLOW' | 'TIDY_UP_WORKFLOW' | 'DUPLICATE_WORKFLOW' | 'SEE_VERSION_WORKFLOW_RUN' | 'SEE_WORKFLOW_WORKFLOW_RUN' | 'STOP_WORKFLOW_RUN' | 'RETRY_WORKFLOW_RUN' | 'SEE_RUNS_WORKFLOW_VERSION' | 'SEE_WORKFLOW_WORKFLOW_VERSION' | 'USE_AS_DRAFT_WORKFLOW_VERSION' | 'SEE_VERSIONS_WORKFLOW_VERSION' | 'SEARCH_RECORDS' | 'SEARCH_RECORDS_FALLBACK' | 'ASK_AI' | 'VIEW_PREVIOUS_AI_CHATS' | 'NAVIGATION' | 'TRIGGER_WORKFLOW_VERSION' | 'FRONT_COMPONENT_RENDERER' | 'REPLY_TO_EMAIL_THREAD' | 'COMPOSE_EMAIL' | 'COMPOSE_CAMPAIGN' | 'GO_TO_PEOPLE' | 'GO_TO_COMPANIES' | 'GO_TO_DASHBOARDS' | 'GO_TO_OPPORTUNITIES' | 'GO_TO_SETTINGS' | 'GO_TO_TASKS' | 'GO_TO_NOTES' | 'GO_TO_WORKFLOWS' | 'GO_TO_RUNS' | 'DELETE_SINGLE_RECORD' | 'DELETE_MULTIPLE_RECORDS' | 'RESTORE_SINGLE_RECORD' | 'RESTORE_MULTIPLE_RECORDS' | 'DESTROY_SINGLE_RECORD' | 'DESTROY_MULTIPLE_RECORDS' | 'EXPORT_FROM_RECORD_INDEX' | 'EXPORT_FROM_RECORD_SHOW' | 'EXPORT_MULTIPLE_RECORDS'
export type CommandMenuItemAvailabilityType = 'GLOBAL' | 'GLOBAL_OBJECT_CONTEXT' | 'RECORD_SELECTION' | 'FALLBACK'
@@ -1099,32 +1099,6 @@ export interface EnterpriseSubscriptionStatusDTO {
__typename: 'EnterpriseSubscriptionStatusDTO'
}
-export interface VerificationRecord {
- type: Scalars['String']
- key: Scalars['String']
- value: Scalars['String']
- priority?: Scalars['Float']
- __typename: 'VerificationRecord'
-}
-
-export interface EmailingDomain {
- id: Scalars['UUID']
- createdAt: Scalars['DateTime']
- updatedAt: Scalars['DateTime']
- domain: Scalars['String']
- status: EmailingDomainStatus
- verificationRecords?: VerificationRecord[]
- verifiedAt?: Scalars['DateTime']
- __typename: 'EmailingDomain'
-}
-
-export type EmailingDomainStatus = 'PENDING' | 'VERIFIED' | 'FAILED' | 'TEMPORARY_FAILURE'
-
-export interface SendEmailViaDomainOutput {
- messageId: Scalars['String']
- __typename: 'SendEmailViaDomainOutput'
-}
-
export interface ApprovedAccessDomain {
id: Scalars['UUID']
domain: Scalars['String']
@@ -1592,7 +1566,7 @@ export interface ClientConfig {
isGoogleCalendarEnabled: Scalars['Boolean']
isConfigVariablesInDbEnabled: Scalars['Boolean']
isImapSmtpCaldavEnabled: Scalars['Boolean']
- isEmailGroupEnabled: Scalars['Boolean']
+ isEmailingDomainInDemoMode: Scalars['Boolean']
allowRequestsToTwentyIcons: Scalars['Boolean']
calendarBookingPageId?: Scalars['String']
isCloudflareIntegrationEnabled: Scalars['Boolean']
@@ -2118,6 +2092,113 @@ export interface PublicDomain {
__typename: 'PublicDomain'
}
+export interface VerificationRecord {
+ type: Scalars['String']
+ key: Scalars['String']
+ value: Scalars['String']
+ priority?: Scalars['Float']
+ __typename: 'VerificationRecord'
+}
+
+export interface EmailingDomain {
+ id: Scalars['UUID']
+ createdAt: Scalars['DateTime']
+ updatedAt: Scalars['DateTime']
+ domain: Scalars['String']
+ status: EmailingDomainStatus
+ verificationRecords?: VerificationRecord[]
+ verifiedAt?: Scalars['DateTime']
+ __typename: 'EmailingDomain'
+}
+
+export type EmailingDomainStatus = 'PENDING' | 'VERIFIED' | 'FAILED' | 'TEMPORARY_FAILURE'
+
+export interface MessageChannel {
+ id: Scalars['UUID']
+ visibility: MessageChannelVisibility
+ handle: Scalars['String']
+ type: MessageChannelType
+ isContactAutoCreationEnabled: Scalars['Boolean']
+ contactAutoCreationPolicy: MessageChannelContactAutoCreationPolicy
+ messageFolderImportPolicy: MessageFolderImportPolicy
+ excludeNonProfessionalEmails: Scalars['Boolean']
+ excludeGroupEmails: Scalars['Boolean']
+ pendingGroupEmailsAction: MessageChannelPendingGroupEmailsAction
+ isSyncEnabled: Scalars['Boolean']
+ syncedAt?: Scalars['DateTime']
+ syncStatus: MessageChannelSyncStatus
+ syncStage: MessageChannelSyncStage
+ syncStageStartedAt?: Scalars['DateTime']
+ throttleFailureCount: Scalars['Float']
+ throttleRetryAfter?: Scalars['DateTime']
+ connectedAccountId: Scalars['UUID']
+ createdAt: Scalars['DateTime']
+ updatedAt: Scalars['DateTime']
+ connectedAccount?: ConnectedAccountPublicDTO
+ __typename: 'MessageChannel'
+}
+
+export type MessageChannelVisibility = 'METADATA' | 'SUBJECT' | 'SHARE_EVERYTHING'
+
+export type MessageChannelType = 'EMAIL' | 'SMS' | 'EMAIL_GROUP'
+
+export type MessageChannelContactAutoCreationPolicy = 'SENT_AND_RECEIVED' | 'SENT' | 'NONE'
+
+export type MessageFolderImportPolicy = 'ALL_FOLDERS' | 'SELECTED_FOLDERS'
+
+export type MessageChannelPendingGroupEmailsAction = 'GROUP_EMAILS_DELETION' | 'GROUP_EMAILS_IMPORT' | 'NONE'
+
+export type MessageChannelSyncStatus = 'NOT_SYNCED' | 'ONGOING' | 'ACTIVE' | 'FAILED_INSUFFICIENT_PERMISSIONS' | 'FAILED_UNKNOWN'
+
+export type MessageChannelSyncStage = 'PENDING_CONFIGURATION' | 'MESSAGE_LIST_FETCH_PENDING' | 'MESSAGE_LIST_FETCH_SCHEDULED' | 'MESSAGE_LIST_FETCH_ONGOING' | 'MESSAGES_IMPORT_PENDING' | 'MESSAGES_IMPORT_SCHEDULED' | 'MESSAGES_IMPORT_ONGOING' | 'FAILED'
+
+export interface CreateEmailGroupChannelOutput {
+ messageChannel: MessageChannel
+ forwardingAddress: Scalars['String']
+ __typename: 'CreateEmailGroupChannelOutput'
+}
+
+export interface CampaignAudiencePreviewDTO {
+ totalMembers: Scalars['Int']
+ withoutEmail: Scalars['Int']
+ duplicateEmails: Scalars['Int']
+ globallyUnsubscribed: Scalars['Int']
+ topicUnsubscribed: Scalars['Int']
+ sendable: Scalars['Int']
+ __typename: 'CampaignAudiencePreviewDTO'
+}
+
+export interface SendEmailViaDomainOutput {
+ messageId: Scalars['String']
+ __typename: 'SendEmailViaDomainOutput'
+}
+
+export interface CampaignSkippedRecipientsDTO {
+ noEmail: Scalars['Int']
+ deduped: Scalars['Int']
+ overCap: Scalars['Int']
+ __typename: 'CampaignSkippedRecipientsDTO'
+}
+
+export interface SendMessageCampaignOutputDTO {
+ campaignId: Scalars['String']
+ queuedCount: Scalars['Int']
+ skipped: CampaignSkippedRecipientsDTO
+ __typename: 'SendMessageCampaignOutputDTO'
+}
+
+export interface UnsubscribeTopic {
+ id: Scalars['UUID']
+ createdAt: Scalars['DateTime']
+ updatedAt: Scalars['DateTime']
+ name?: Scalars['String']
+ description?: Scalars['String']
+ visibility: UnsubscribeTopicVisibility
+ __typename: 'UnsubscribeTopic'
+}
+
+export type UnsubscribeTopicVisibility = 'PUBLIC' | 'PRIVATE'
+
export interface AutocompleteResult {
text: Scalars['String']
placeId: Scalars['String']
@@ -2472,51 +2553,6 @@ export type CalendarChannelVisibility = 'METADATA' | 'SHARE_EVERYTHING'
export type CalendarChannelContactAutoCreationPolicy = 'AS_PARTICIPANT_AND_ORGANIZER' | 'AS_PARTICIPANT' | 'AS_ORGANIZER' | 'NONE'
-export interface MessageChannel {
- id: Scalars['UUID']
- visibility: MessageChannelVisibility
- handle: Scalars['String']
- type: MessageChannelType
- isContactAutoCreationEnabled: Scalars['Boolean']
- contactAutoCreationPolicy: MessageChannelContactAutoCreationPolicy
- messageFolderImportPolicy: MessageFolderImportPolicy
- excludeNonProfessionalEmails: Scalars['Boolean']
- excludeGroupEmails: Scalars['Boolean']
- pendingGroupEmailsAction: MessageChannelPendingGroupEmailsAction
- isSyncEnabled: Scalars['Boolean']
- syncedAt?: Scalars['DateTime']
- syncStatus: MessageChannelSyncStatus
- syncStage: MessageChannelSyncStage
- syncStageStartedAt?: Scalars['DateTime']
- throttleFailureCount: Scalars['Float']
- throttleRetryAfter?: Scalars['DateTime']
- connectedAccountId: Scalars['UUID']
- createdAt: Scalars['DateTime']
- updatedAt: Scalars['DateTime']
- connectedAccount?: ConnectedAccountPublicDTO
- __typename: 'MessageChannel'
-}
-
-export type MessageChannelVisibility = 'METADATA' | 'SUBJECT' | 'SHARE_EVERYTHING'
-
-export type MessageChannelType = 'EMAIL' | 'SMS' | 'EMAIL_GROUP'
-
-export type MessageChannelContactAutoCreationPolicy = 'SENT_AND_RECEIVED' | 'SENT' | 'NONE'
-
-export type MessageFolderImportPolicy = 'ALL_FOLDERS' | 'SELECTED_FOLDERS'
-
-export type MessageChannelPendingGroupEmailsAction = 'GROUP_EMAILS_DELETION' | 'GROUP_EMAILS_IMPORT' | 'NONE'
-
-export type MessageChannelSyncStatus = 'NOT_SYNCED' | 'ONGOING' | 'ACTIVE' | 'FAILED_INSUFFICIENT_PERMISSIONS' | 'FAILED_UNKNOWN'
-
-export type MessageChannelSyncStage = 'PENDING_CONFIGURATION' | 'MESSAGE_LIST_FETCH_PENDING' | 'MESSAGE_LIST_FETCH_SCHEDULED' | 'MESSAGE_LIST_FETCH_ONGOING' | 'MESSAGES_IMPORT_PENDING' | 'MESSAGES_IMPORT_SCHEDULED' | 'MESSAGES_IMPORT_ONGOING' | 'FAILED'
-
-export interface CreateEmailGroupChannelOutput {
- messageChannel: MessageChannel
- forwardingAddress: Scalars['String']
- __typename: 'CreateEmailGroupChannelOutput'
-}
-
export interface MessageFolder {
id: Scalars['UUID']
name?: Scalars['String']
@@ -2600,7 +2636,6 @@ export interface Query {
getPageLayoutTab: PageLayoutTab
getPageLayouts: PageLayout[]
getPageLayout?: PageLayout
- getEmailingDomains: EmailingDomain[]
applicationConnectionProviders: ApplicationConnectionProvider[]
getPageLayoutWidgets: PageLayoutWidget[]
getPageLayoutWidget: PageLayoutWidget
@@ -2619,6 +2654,12 @@ export interface Query {
indexMetadatas: IndexConnection
findManyAgents: Agent[]
findOneAgent: Agent
+ previewMessageCampaignAudience: CampaignAudiencePreviewDTO
+ unsubscribeTopics: UnsubscribeTopic[]
+ unsubscribePagePreviewUrl: Scalars['String']
+ myMessageChannels: MessageChannel[]
+ getEmailingDomains: EmailingDomain[]
+ myConnectedAccounts: ConnectedAccountPublicDTO[]
getRoles: Role[]
getToolIndex: ToolIndexEntry[]
getToolInputSchema?: Scalars['JSON']
@@ -2629,8 +2670,6 @@ export interface Query {
getViewGroups: ViewGroup[]
getViewGroup?: ViewGroup
myMessageFolders: MessageFolder[]
- myMessageChannels: MessageChannel[]
- myConnectedAccounts: ConnectedAccountPublicDTO[]
myCalendarChannels: CalendarChannel[]
minimalMetadata: MinimalMetadata
appConnections: AppConnection[]
@@ -2756,10 +2795,6 @@ export interface Mutation {
resetPageLayoutToDefault: PageLayout
resetPageLayoutWidgetToDefault: PageLayoutWidget
resetPageLayoutTabToDefault: PageLayoutTab
- createEmailingDomain: EmailingDomain
- deleteEmailingDomain: Scalars['Boolean']
- verifyEmailingDomain: EmailingDomain
- sendEmailViaEmailingDomain: SendEmailViaDomainOutput
updateOneApplicationVariable: Scalars['Boolean']
createPageLayoutWidget: PageLayoutWidget
updatePageLayoutWidget: PageLayoutWidget
@@ -2782,6 +2817,18 @@ export interface Mutation {
createOneAgent: Agent
updateOneAgent: Agent
deleteOneAgent: Agent
+ sendEmailViaEmailingDomain: SendEmailViaDomainOutput
+ sendMessageCampaign: SendMessageCampaignOutputDTO
+ createUnsubscribeTopic: UnsubscribeTopic
+ updateUnsubscribeTopic: UnsubscribeTopic
+ deleteUnsubscribeTopic: Scalars['Boolean']
+ updateMessageChannel: MessageChannel
+ createEmailGroupChannel: CreateEmailGroupChannelOutput
+ deleteEmailGroupChannel: MessageChannel
+ createEmailingDomain: EmailingDomain
+ deleteEmailingDomain: Scalars['Boolean']
+ verifyEmailingDomain: EmailingDomain
+ deleteConnectedAccount: ConnectedAccountPublicDTO
updateWorkspaceMemberRole: WorkspaceMember
createOneRole: Role
updateOneRole: Role
@@ -2807,10 +2854,6 @@ export interface Mutation {
destroyViewGroup: ViewGroup
updateMessageFolder: MessageFolder
updateMessageFolders: MessageFolder[]
- updateMessageChannel: MessageChannel
- createEmailGroupChannel: CreateEmailGroupChannelOutput
- deleteEmailGroupChannel: MessageChannel
- deleteConnectedAccount: ConnectedAccountPublicDTO
updateCalendarChannel: CalendarChannel
createChatThread: AgentChatThread
sendChatMessage: SendChatMessageResult
@@ -4064,33 +4107,6 @@ export interface EnterpriseSubscriptionStatusDTOGenqlSelection{
__scalar?: boolean | number
}
-export interface VerificationRecordGenqlSelection{
- type?: boolean | number
- key?: boolean | number
- value?: boolean | number
- priority?: boolean | number
- __typename?: boolean | number
- __scalar?: boolean | number
-}
-
-export interface EmailingDomainGenqlSelection{
- id?: boolean | number
- createdAt?: boolean | number
- updatedAt?: boolean | number
- domain?: boolean | number
- status?: boolean | number
- verificationRecords?: VerificationRecordGenqlSelection
- verifiedAt?: boolean | number
- __typename?: boolean | number
- __scalar?: boolean | number
-}
-
-export interface SendEmailViaDomainOutputGenqlSelection{
- messageId?: boolean | number
- __typename?: boolean | number
- __scalar?: boolean | number
-}
-
export interface ApprovedAccessDomainGenqlSelection{
id?: boolean | number
domain?: boolean | number
@@ -4566,7 +4582,7 @@ export interface ClientConfigGenqlSelection{
isGoogleCalendarEnabled?: boolean | number
isConfigVariablesInDbEnabled?: boolean | number
isImapSmtpCaldavEnabled?: boolean | number
- isEmailGroupEnabled?: boolean | number
+ isEmailingDomainInDemoMode?: boolean | number
allowRequestsToTwentyIcons?: boolean | number
calendarBookingPageId?: boolean | number
isCloudflareIntegrationEnabled?: boolean | number
@@ -5155,34 +5171,132 @@ export interface PublicDomainGenqlSelection{
__scalar?: boolean | number
}
-export interface AutocompleteResultGenqlSelection{
- text?: boolean | number
- placeId?: boolean | number
+export interface VerificationRecordGenqlSelection{
+ type?: boolean | number
+ key?: boolean | number
+ value?: boolean | number
+ priority?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
}
-export interface LocationGenqlSelection{
- lat?: boolean | number
- lng?: boolean | number
+export interface EmailingDomainGenqlSelection{
+ id?: boolean | number
+ createdAt?: boolean | number
+ updatedAt?: boolean | number
+ domain?: boolean | number
+ status?: boolean | number
+ verificationRecords?: VerificationRecordGenqlSelection
+ verifiedAt?: boolean | number
__typename?: boolean | number
__scalar?: boolean | number
}
-export interface PlaceDetailsResultGenqlSelection{
- street?: boolean | number
- state?: boolean | number
- postcode?: boolean | number
- city?: boolean | number
- country?: boolean | number
- location?: LocationGenqlSelection
+export interface MessageChannelGenqlSelection{
+ id?: boolean | number
+ visibility?: boolean | number
+ handle?: boolean | number
+ type?: boolean | number
+ isContactAutoCreationEnabled?: boolean | number
+ contactAutoCreationPolicy?: boolean | number
+ messageFolderImportPolicy?: boolean | number
+ excludeNonProfessionalEmails?: boolean | number
+ excludeGroupEmails?: boolean | number
+ pendingGroupEmailsAction?: boolean | number
+ isSyncEnabled?: boolean | number
+ syncedAt?: boolean | number
+ syncStatus?: boolean | number
+ syncStage?: boolean | number
+ syncStageStartedAt?: boolean | number
+ throttleFailureCount?: boolean | number
+ throttleRetryAfter?: boolean | number
+ connectedAccountId?: boolean | number
+ createdAt?: boolean | number
+ updatedAt?: boolean | number
+ connectedAccount?: ConnectedAccountPublicDTOGenqlSelection
__typename?: boolean | number
__scalar?: boolean | number
}
-export interface ImapSmtpCaldavPublicConnectionParamsGenqlSelection{
- host?: boolean | number
- port?: boolean | number
+export interface CreateEmailGroupChannelOutputGenqlSelection{
+ messageChannel?: MessageChannelGenqlSelection
+ forwardingAddress?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface CampaignAudiencePreviewDTOGenqlSelection{
+ totalMembers?: boolean | number
+ withoutEmail?: boolean | number
+ duplicateEmails?: boolean | number
+ globallyUnsubscribed?: boolean | number
+ topicUnsubscribed?: boolean | number
+ sendable?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface SendEmailViaDomainOutputGenqlSelection{
+ messageId?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface CampaignSkippedRecipientsDTOGenqlSelection{
+ noEmail?: boolean | number
+ deduped?: boolean | number
+ overCap?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface SendMessageCampaignOutputDTOGenqlSelection{
+ campaignId?: boolean | number
+ queuedCount?: boolean | number
+ skipped?: CampaignSkippedRecipientsDTOGenqlSelection
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface UnsubscribeTopicGenqlSelection{
+ id?: boolean | number
+ createdAt?: boolean | number
+ updatedAt?: boolean | number
+ name?: boolean | number
+ description?: boolean | number
+ visibility?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface AutocompleteResultGenqlSelection{
+ text?: boolean | number
+ placeId?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface LocationGenqlSelection{
+ lat?: boolean | number
+ lng?: boolean | number
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface PlaceDetailsResultGenqlSelection{
+ street?: boolean | number
+ state?: boolean | number
+ postcode?: boolean | number
+ city?: boolean | number
+ country?: boolean | number
+ location?: LocationGenqlSelection
+ __typename?: boolean | number
+ __scalar?: boolean | number
+}
+
+export interface ImapSmtpCaldavPublicConnectionParamsGenqlSelection{
+ host?: boolean | number
+ port?: boolean | number
username?: boolean | number
secure?: boolean | number
__typename?: boolean | number
@@ -5538,39 +5652,6 @@ export interface CalendarChannelGenqlSelection{
__scalar?: boolean | number
}
-export interface MessageChannelGenqlSelection{
- id?: boolean | number
- visibility?: boolean | number
- handle?: boolean | number
- type?: boolean | number
- isContactAutoCreationEnabled?: boolean | number
- contactAutoCreationPolicy?: boolean | number
- messageFolderImportPolicy?: boolean | number
- excludeNonProfessionalEmails?: boolean | number
- excludeGroupEmails?: boolean | number
- pendingGroupEmailsAction?: boolean | number
- isSyncEnabled?: boolean | number
- syncedAt?: boolean | number
- syncStatus?: boolean | number
- syncStage?: boolean | number
- syncStageStartedAt?: boolean | number
- throttleFailureCount?: boolean | number
- throttleRetryAfter?: boolean | number
- connectedAccountId?: boolean | number
- createdAt?: boolean | number
- updatedAt?: boolean | number
- connectedAccount?: ConnectedAccountPublicDTOGenqlSelection
- __typename?: boolean | number
- __scalar?: boolean | number
-}
-
-export interface CreateEmailGroupChannelOutputGenqlSelection{
- messageChannel?: MessageChannelGenqlSelection
- forwardingAddress?: boolean | number
- __typename?: boolean | number
- __scalar?: boolean | number
-}
-
export interface MessageFolderGenqlSelection{
id?: boolean | number
name?: boolean | number
@@ -5655,7 +5736,6 @@ export interface QueryGenqlSelection{
getPageLayoutTab?: (PageLayoutTabGenqlSelection & { __args: {id: Scalars['String']} })
getPageLayouts?: (PageLayoutGenqlSelection & { __args?: {objectMetadataId?: (Scalars['String'] | null), pageLayoutType?: (PageLayoutType | null)} })
getPageLayout?: (PageLayoutGenqlSelection & { __args: {id: Scalars['String']} })
- getEmailingDomains?: EmailingDomainGenqlSelection
applicationConnectionProviders?: (ApplicationConnectionProviderGenqlSelection & { __args: {applicationId: Scalars['UUID']} })
getPageLayoutWidgets?: (PageLayoutWidgetGenqlSelection & { __args: {pageLayoutTabId: Scalars['String']} })
getPageLayoutWidget?: (PageLayoutWidgetGenqlSelection & { __args: {id: Scalars['String']} })
@@ -5686,6 +5766,12 @@ export interface QueryGenqlSelection{
filter: IndexFilter} })
findManyAgents?: AgentGenqlSelection
findOneAgent?: (AgentGenqlSelection & { __args: {input: AgentIdInput} })
+ previewMessageCampaignAudience?: (CampaignAudiencePreviewDTOGenqlSelection & { __args: {input: PreviewMessageCampaignAudienceInput} })
+ unsubscribeTopics?: UnsubscribeTopicGenqlSelection
+ unsubscribePagePreviewUrl?: boolean | number
+ myMessageChannels?: (MessageChannelGenqlSelection & { __args?: {connectedAccountId?: (Scalars['UUID'] | null)} })
+ getEmailingDomains?: EmailingDomainGenqlSelection
+ myConnectedAccounts?: ConnectedAccountPublicDTOGenqlSelection
getRoles?: RoleGenqlSelection
getToolIndex?: ToolIndexEntryGenqlSelection
getToolInputSchema?: { __args: {toolName: Scalars['String']} }
@@ -5702,8 +5788,6 @@ export interface QueryGenqlSelection{
getViewGroups?: (ViewGroupGenqlSelection & { __args?: {viewId?: (Scalars['String'] | null)} })
getViewGroup?: (ViewGroupGenqlSelection & { __args: {id: Scalars['String']} })
myMessageFolders?: (MessageFolderGenqlSelection & { __args?: {messageChannelId?: (Scalars['UUID'] | null)} })
- myMessageChannels?: (MessageChannelGenqlSelection & { __args?: {connectedAccountId?: (Scalars['UUID'] | null)} })
- myConnectedAccounts?: ConnectedAccountPublicDTOGenqlSelection
myCalendarChannels?: (CalendarChannelGenqlSelection & { __args?: {connectedAccountId?: (Scalars['UUID'] | null)} })
minimalMetadata?: MinimalMetadataGenqlSelection
appConnections?: (AppConnectionGenqlSelection & { __args?: {filter?: (ListAppConnectionsInput | null)} })
@@ -5760,6 +5844,8 @@ export interface AgentIdInput {
/** The id of the agent. */
id: Scalars['UUID']}
+export interface PreviewMessageCampaignAudienceInput {listId: Scalars['String'],unsubscribeTopicId?: (Scalars['String'] | null)}
+
export interface ListAppConnectionsInput {providerName?: (Scalars['String'] | null),userWorkspaceId?: (Scalars['String'] | null),visibility?: (Scalars['String'] | null)}
export interface EventLogQueryInput {table: EventLogTable,filters?: (EventLogFiltersInput | null),first?: (Scalars['Int'] | null),after?: (Scalars['String'] | null)}
@@ -5852,10 +5938,6 @@ export interface MutationGenqlSelection{
resetPageLayoutToDefault?: (PageLayoutGenqlSelection & { __args: {id: Scalars['String']} })
resetPageLayoutWidgetToDefault?: (PageLayoutWidgetGenqlSelection & { __args: {id: Scalars['String']} })
resetPageLayoutTabToDefault?: (PageLayoutTabGenqlSelection & { __args: {id: Scalars['String']} })
- createEmailingDomain?: (EmailingDomainGenqlSelection & { __args: {domain: Scalars['String']} })
- deleteEmailingDomain?: { __args: {id: Scalars['String']} }
- verifyEmailingDomain?: (EmailingDomainGenqlSelection & { __args: {id: Scalars['String']} })
- sendEmailViaEmailingDomain?: (SendEmailViaDomainOutputGenqlSelection & { __args: {input: SendEmailViaDomainInput} })
updateOneApplicationVariable?: { __args: {key: Scalars['String'], value: Scalars['String'], applicationId: Scalars['UUID']} }
createPageLayoutWidget?: (PageLayoutWidgetGenqlSelection & { __args: {input: CreatePageLayoutWidgetInput} })
updatePageLayoutWidget?: (PageLayoutWidgetGenqlSelection & { __args: {id: Scalars['String'], input: UpdatePageLayoutWidgetInput} })
@@ -5878,6 +5960,18 @@ export interface MutationGenqlSelection{
createOneAgent?: (AgentGenqlSelection & { __args: {input: CreateAgentInput} })
updateOneAgent?: (AgentGenqlSelection & { __args: {input: UpdateAgentInput} })
deleteOneAgent?: (AgentGenqlSelection & { __args: {input: AgentIdInput} })
+ sendEmailViaEmailingDomain?: (SendEmailViaDomainOutputGenqlSelection & { __args: {input: SendEmailViaDomainInput} })
+ sendMessageCampaign?: (SendMessageCampaignOutputDTOGenqlSelection & { __args: {input: SendMessageCampaignInput} })
+ createUnsubscribeTopic?: (UnsubscribeTopicGenqlSelection & { __args: {input: CreateUnsubscribeTopicInput} })
+ updateUnsubscribeTopic?: (UnsubscribeTopicGenqlSelection & { __args: {input: UpdateUnsubscribeTopicInput} })
+ deleteUnsubscribeTopic?: { __args: {id: Scalars['String']} }
+ updateMessageChannel?: (MessageChannelGenqlSelection & { __args: {input: UpdateMessageChannelInput} })
+ createEmailGroupChannel?: (CreateEmailGroupChannelOutputGenqlSelection & { __args: {input: CreateEmailGroupChannelInput} })
+ deleteEmailGroupChannel?: (MessageChannelGenqlSelection & { __args: {id: Scalars['UUID']} })
+ createEmailingDomain?: (EmailingDomainGenqlSelection & { __args: {input: CreateEmailingDomainInput} })
+ deleteEmailingDomain?: { __args: {id: Scalars['String']} }
+ verifyEmailingDomain?: (EmailingDomainGenqlSelection & { __args: {id: Scalars['String']} })
+ deleteConnectedAccount?: (ConnectedAccountPublicDTOGenqlSelection & { __args: {id: Scalars['UUID']} })
updateWorkspaceMemberRole?: (WorkspaceMemberGenqlSelection & { __args: {workspaceMemberId: Scalars['UUID'], roleId: Scalars['UUID']} })
createOneRole?: (RoleGenqlSelection & { __args: {createRoleInput: CreateRoleInput} })
updateOneRole?: (RoleGenqlSelection & { __args: {updateRoleInput: UpdateRoleInput} })
@@ -5903,10 +5997,6 @@ export interface MutationGenqlSelection{
destroyViewGroup?: (ViewGroupGenqlSelection & { __args: {input: DestroyViewGroupInput} })
updateMessageFolder?: (MessageFolderGenqlSelection & { __args: {input: UpdateMessageFolderInput} })
updateMessageFolders?: (MessageFolderGenqlSelection & { __args: {input: UpdateMessageFoldersInput} })
- updateMessageChannel?: (MessageChannelGenqlSelection & { __args: {input: UpdateMessageChannelInput} })
- createEmailGroupChannel?: (CreateEmailGroupChannelOutputGenqlSelection & { __args: {input: CreateEmailGroupChannelInput} })
- deleteEmailGroupChannel?: (MessageChannelGenqlSelection & { __args: {id: Scalars['UUID']} })
- deleteConnectedAccount?: (ConnectedAccountPublicDTOGenqlSelection & { __args: {id: Scalars['UUID']} })
updateCalendarChannel?: (CalendarChannelGenqlSelection & { __args: {input: UpdateCalendarChannelInput} })
createChatThread?: AgentChatThreadGenqlSelection
sendChatMessage?: (SendChatMessageResultGenqlSelection & { __args: {threadId: Scalars['UUID'], text: Scalars['String'], messageId: Scalars['UUID'], browsingContext?: (Scalars['JSON'] | null), modelId?: (Scalars['String'] | null), fileAttachments?: (FileAttachmentInput[] | null)} })
@@ -6157,8 +6247,6 @@ export interface UpdatePageLayoutWidgetWithIdInput {id: Scalars['UUID'],pageLayo
export interface GridPositionInput {row: Scalars['Float'],column: Scalars['Float'],rowSpan: Scalars['Float'],columnSpan: Scalars['Float']}
-export interface SendEmailViaDomainInput {emailingDomainId: Scalars['String'],to: Scalars['String'][],cc?: (Scalars['String'][] | null),bcc?: (Scalars['String'][] | null),subject: Scalars['String'],text: Scalars['String'],html?: (Scalars['String'] | null),from: Scalars['String'],replyTo?: (Scalars['String'][] | null)}
-
export interface CreatePageLayoutWidgetInput {pageLayoutTabId: Scalars['UUID'],title: Scalars['String'],type: WidgetType,objectMetadataId?: (Scalars['UUID'] | null),gridPosition: GridPositionInput,position?: (Scalars['JSON'] | null),configuration: Scalars['JSON']}
export interface UpdatePageLayoutWidgetInput {pageLayoutTabId?: (Scalars['UUID'] | null),title?: (Scalars['String'] | null),type?: (WidgetType | null),objectMetadataId?: (Scalars['UUID'] | null),gridPosition?: (GridPositionInput | null),position?: (Scalars['JSON'] | null),configuration?: (Scalars['JSON'] | null),conditionalDisplay?: (Scalars['JSON'] | null),conditionalAvailabilityExpression?: (Scalars['String'] | null)}
@@ -6225,6 +6313,22 @@ export interface CreateAgentInput {name?: (Scalars['String'] | null),label: Scal
export interface UpdateAgentInput {id: Scalars['UUID'],name?: (Scalars['String'] | null),label?: (Scalars['String'] | null),icon?: (Scalars['String'] | null),description?: (Scalars['String'] | null),prompt?: (Scalars['String'] | null),modelId?: (Scalars['String'] | null),roleId?: (Scalars['UUID'] | null),responseFormat?: (Scalars['JSON'] | null),modelConfiguration?: (Scalars['JSON'] | null),evaluationInputs?: (Scalars['String'][] | null)}
+export interface SendEmailViaDomainInput {emailingDomainId: Scalars['String'],to: Scalars['String'][],cc?: (Scalars['String'][] | null),bcc?: (Scalars['String'][] | null),subject: Scalars['String'],text: Scalars['String'],html?: (Scalars['String'] | null),from: Scalars['String'],replyTo?: (Scalars['String'][] | null)}
+
+export interface SendMessageCampaignInput {listId: Scalars['String'],unsubscribeTopicId?: (Scalars['String'] | null),subject: Scalars['String'],body: Scalars['String'],fromAddress: Scalars['String']}
+
+export interface CreateUnsubscribeTopicInput {name: Scalars['String'],description?: (Scalars['String'] | null),visibility?: (UnsubscribeTopicVisibility | null)}
+
+export interface UpdateUnsubscribeTopicInput {id: Scalars['String'],name?: (Scalars['String'] | null),description?: (Scalars['String'] | null),visibility?: (UnsubscribeTopicVisibility | null)}
+
+export interface UpdateMessageChannelInput {id: Scalars['UUID'],update: UpdateMessageChannelInputUpdates}
+
+export interface UpdateMessageChannelInputUpdates {visibility?: (MessageChannelVisibility | null),isContactAutoCreationEnabled?: (Scalars['Boolean'] | null),contactAutoCreationPolicy?: (MessageChannelContactAutoCreationPolicy | null),messageFolderImportPolicy?: (MessageFolderImportPolicy | null),isSyncEnabled?: (Scalars['Boolean'] | null),excludeNonProfessionalEmails?: (Scalars['Boolean'] | null),excludeGroupEmails?: (Scalars['Boolean'] | null)}
+
+export interface CreateEmailGroupChannelInput {handle: Scalars['String']}
+
+export interface CreateEmailingDomainInput {domain: Scalars['String']}
+
export interface CreateRoleInput {id?: (Scalars['String'] | null),label: Scalars['String'],description?: (Scalars['String'] | null),icon?: (Scalars['String'] | null),canUpdateAllSettings?: (Scalars['Boolean'] | null),canAccessAllTools?: (Scalars['Boolean'] | null),canReadAllObjectRecords?: (Scalars['Boolean'] | null),canUpdateAllObjectRecords?: (Scalars['Boolean'] | null),canSoftDeleteAllObjectRecords?: (Scalars['Boolean'] | null),canDestroyAllObjectRecords?: (Scalars['Boolean'] | null),canBeAssignedToUsers?: (Scalars['Boolean'] | null),canBeAssignedToAgents?: (Scalars['Boolean'] | null),canBeAssignedToApiKeys?: (Scalars['Boolean'] | null)}
export interface UpdateRoleInput {update: UpdateRolePayload,
@@ -6303,12 +6407,6 @@ export interface UpdateMessageFolderInputUpdates {isSynced?: (Scalars['Boolean']
export interface UpdateMessageFoldersInput {ids: Scalars['UUID'][],update: UpdateMessageFolderInputUpdates}
-export interface UpdateMessageChannelInput {id: Scalars['UUID'],update: UpdateMessageChannelInputUpdates}
-
-export interface UpdateMessageChannelInputUpdates {visibility?: (MessageChannelVisibility | null),isContactAutoCreationEnabled?: (Scalars['Boolean'] | null),contactAutoCreationPolicy?: (MessageChannelContactAutoCreationPolicy | null),messageFolderImportPolicy?: (MessageFolderImportPolicy | null),isSyncEnabled?: (Scalars['Boolean'] | null),excludeNonProfessionalEmails?: (Scalars['Boolean'] | null),excludeGroupEmails?: (Scalars['Boolean'] | null)}
-
-export interface CreateEmailGroupChannelInput {handle: Scalars['String']}
-
export interface UpdateCalendarChannelInput {id: Scalars['UUID'],update: UpdateCalendarChannelInputUpdates}
export interface UpdateCalendarChannelInputUpdates {visibility?: (CalendarChannelVisibility | null),isContactAutoCreationEnabled?: (Scalars['Boolean'] | null),contactAutoCreationPolicy?: (CalendarChannelContactAutoCreationPolicy | null),isSyncEnabled?: (Scalars['Boolean'] | null)}
@@ -7019,30 +7117,6 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
- const VerificationRecord_possibleTypes: string[] = ['VerificationRecord']
- export const isVerificationRecord = (obj?: { __typename?: any } | null): obj is VerificationRecord => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isVerificationRecord"')
- return VerificationRecord_possibleTypes.includes(obj.__typename)
- }
-
-
-
- const EmailingDomain_possibleTypes: string[] = ['EmailingDomain']
- export const isEmailingDomain = (obj?: { __typename?: any } | null): obj is EmailingDomain => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isEmailingDomain"')
- return EmailingDomain_possibleTypes.includes(obj.__typename)
- }
-
-
-
- const SendEmailViaDomainOutput_possibleTypes: string[] = ['SendEmailViaDomainOutput']
- export const isSendEmailViaDomainOutput = (obj?: { __typename?: any } | null): obj is SendEmailViaDomainOutput => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isSendEmailViaDomainOutput"')
- return SendEmailViaDomainOutput_possibleTypes.includes(obj.__typename)
- }
-
-
-
const ApprovedAccessDomain_possibleTypes: string[] = ['ApprovedAccessDomain']
export const isApprovedAccessDomain = (obj?: { __typename?: any } | null): obj is ApprovedAccessDomain => {
if (!obj?.__typename) throw new Error('__typename is missing in "isApprovedAccessDomain"')
@@ -7979,6 +8053,78 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
+ const VerificationRecord_possibleTypes: string[] = ['VerificationRecord']
+ export const isVerificationRecord = (obj?: { __typename?: any } | null): obj is VerificationRecord => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isVerificationRecord"')
+ return VerificationRecord_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const EmailingDomain_possibleTypes: string[] = ['EmailingDomain']
+ export const isEmailingDomain = (obj?: { __typename?: any } | null): obj is EmailingDomain => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isEmailingDomain"')
+ return EmailingDomain_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const MessageChannel_possibleTypes: string[] = ['MessageChannel']
+ export const isMessageChannel = (obj?: { __typename?: any } | null): obj is MessageChannel => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isMessageChannel"')
+ return MessageChannel_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const CreateEmailGroupChannelOutput_possibleTypes: string[] = ['CreateEmailGroupChannelOutput']
+ export const isCreateEmailGroupChannelOutput = (obj?: { __typename?: any } | null): obj is CreateEmailGroupChannelOutput => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isCreateEmailGroupChannelOutput"')
+ return CreateEmailGroupChannelOutput_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const CampaignAudiencePreviewDTO_possibleTypes: string[] = ['CampaignAudiencePreviewDTO']
+ export const isCampaignAudiencePreviewDTO = (obj?: { __typename?: any } | null): obj is CampaignAudiencePreviewDTO => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isCampaignAudiencePreviewDTO"')
+ return CampaignAudiencePreviewDTO_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const SendEmailViaDomainOutput_possibleTypes: string[] = ['SendEmailViaDomainOutput']
+ export const isSendEmailViaDomainOutput = (obj?: { __typename?: any } | null): obj is SendEmailViaDomainOutput => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSendEmailViaDomainOutput"')
+ return SendEmailViaDomainOutput_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const CampaignSkippedRecipientsDTO_possibleTypes: string[] = ['CampaignSkippedRecipientsDTO']
+ export const isCampaignSkippedRecipientsDTO = (obj?: { __typename?: any } | null): obj is CampaignSkippedRecipientsDTO => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isCampaignSkippedRecipientsDTO"')
+ return CampaignSkippedRecipientsDTO_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const SendMessageCampaignOutputDTO_possibleTypes: string[] = ['SendMessageCampaignOutputDTO']
+ export const isSendMessageCampaignOutputDTO = (obj?: { __typename?: any } | null): obj is SendMessageCampaignOutputDTO => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isSendMessageCampaignOutputDTO"')
+ return SendMessageCampaignOutputDTO_possibleTypes.includes(obj.__typename)
+ }
+
+
+
+ const UnsubscribeTopic_possibleTypes: string[] = ['UnsubscribeTopic']
+ export const isUnsubscribeTopic = (obj?: { __typename?: any } | null): obj is UnsubscribeTopic => {
+ if (!obj?.__typename) throw new Error('__typename is missing in "isUnsubscribeTopic"')
+ return UnsubscribeTopic_possibleTypes.includes(obj.__typename)
+ }
+
+
+
const AutocompleteResult_possibleTypes: string[] = ['AutocompleteResult']
export const isAutocompleteResult = (obj?: { __typename?: any } | null): obj is AutocompleteResult => {
if (!obj?.__typename) throw new Error('__typename is missing in "isAutocompleteResult"')
@@ -8275,22 +8421,6 @@ export interface LogicFunctionLogsInput {applicationId?: (Scalars['UUID'] | null
- const MessageChannel_possibleTypes: string[] = ['MessageChannel']
- export const isMessageChannel = (obj?: { __typename?: any } | null): obj is MessageChannel => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isMessageChannel"')
- return MessageChannel_possibleTypes.includes(obj.__typename)
- }
-
-
-
- const CreateEmailGroupChannelOutput_possibleTypes: string[] = ['CreateEmailGroupChannelOutput']
- export const isCreateEmailGroupChannelOutput = (obj?: { __typename?: any } | null): obj is CreateEmailGroupChannelOutput => {
- if (!obj?.__typename) throw new Error('__typename is missing in "isCreateEmailGroupChannelOutput"')
- return CreateEmailGroupChannelOutput_possibleTypes.includes(obj.__typename)
- }
-
-
-
const MessageFolder_possibleTypes: string[] = ['MessageFolder']
export const isMessageFolder = (obj?: { __typename?: any } | null): obj is MessageFolder => {
if (!obj?.__typename) throw new Error('__typename is missing in "isMessageFolder"')
@@ -8484,6 +8614,7 @@ export const enumEngineComponentKey = {
FRONT_COMPONENT_RENDERER: 'FRONT_COMPONENT_RENDERER' as const,
REPLY_TO_EMAIL_THREAD: 'REPLY_TO_EMAIL_THREAD' as const,
COMPOSE_EMAIL: 'COMPOSE_EMAIL' as const,
+ COMPOSE_CAMPAIGN: 'COMPOSE_CAMPAIGN' as const,
GO_TO_PEOPLE: 'GO_TO_PEOPLE' as const,
GO_TO_COMPANIES: 'GO_TO_COMPANIES' as const,
GO_TO_DASHBOARDS: 'GO_TO_DASHBOARDS' as const,
@@ -8747,13 +8878,6 @@ export const enumPageLayoutType = {
STANDALONE_PAGE: 'STANDALONE_PAGE' as const
}
-export const enumEmailingDomainStatus = {
- PENDING: 'PENDING' as const,
- VERIFIED: 'VERIFIED' as const,
- FAILED: 'FAILED' as const,
- TEMPORARY_FAILURE: 'TEMPORARY_FAILURE' as const
-}
-
export const enumBillingPlanKey = {
PRO: 'PRO' as const,
ENTERPRISE: 'ENTERPRISE' as const
@@ -8869,35 +8993,11 @@ export const enumBillingEntitlementKey = {
AUDIT_LOGS: 'AUDIT_LOGS' as const
}
-export const enumCalendarChannelSyncStatus = {
- NOT_SYNCED: 'NOT_SYNCED' as const,
- ONGOING: 'ONGOING' as const,
- ACTIVE: 'ACTIVE' as const,
- FAILED_INSUFFICIENT_PERMISSIONS: 'FAILED_INSUFFICIENT_PERMISSIONS' as const,
- FAILED_UNKNOWN: 'FAILED_UNKNOWN' as const
-}
-
-export const enumCalendarChannelSyncStage = {
- PENDING_CONFIGURATION: 'PENDING_CONFIGURATION' as const,
- CALENDAR_EVENT_LIST_FETCH_PENDING: 'CALENDAR_EVENT_LIST_FETCH_PENDING' as const,
- CALENDAR_EVENT_LIST_FETCH_SCHEDULED: 'CALENDAR_EVENT_LIST_FETCH_SCHEDULED' as const,
- CALENDAR_EVENT_LIST_FETCH_ONGOING: 'CALENDAR_EVENT_LIST_FETCH_ONGOING' as const,
- CALENDAR_EVENTS_IMPORT_PENDING: 'CALENDAR_EVENTS_IMPORT_PENDING' as const,
- CALENDAR_EVENTS_IMPORT_SCHEDULED: 'CALENDAR_EVENTS_IMPORT_SCHEDULED' as const,
- CALENDAR_EVENTS_IMPORT_ONGOING: 'CALENDAR_EVENTS_IMPORT_ONGOING' as const,
- FAILED: 'FAILED' as const
-}
-
-export const enumCalendarChannelVisibility = {
- METADATA: 'METADATA' as const,
- SHARE_EVERYTHING: 'SHARE_EVERYTHING' as const
-}
-
-export const enumCalendarChannelContactAutoCreationPolicy = {
- AS_PARTICIPANT_AND_ORGANIZER: 'AS_PARTICIPANT_AND_ORGANIZER' as const,
- AS_PARTICIPANT: 'AS_PARTICIPANT' as const,
- AS_ORGANIZER: 'AS_ORGANIZER' as const,
- NONE: 'NONE' as const
+export const enumEmailingDomainStatus = {
+ PENDING: 'PENDING' as const,
+ VERIFIED: 'VERIFIED' as const,
+ FAILED: 'FAILED' as const,
+ TEMPORARY_FAILURE: 'TEMPORARY_FAILURE' as const
}
export const enumMessageChannelVisibility = {
@@ -8948,6 +9048,42 @@ export const enumMessageChannelSyncStage = {
FAILED: 'FAILED' as const
}
+export const enumUnsubscribeTopicVisibility = {
+ PUBLIC: 'PUBLIC' as const,
+ PRIVATE: 'PRIVATE' as const
+}
+
+export const enumCalendarChannelSyncStatus = {
+ NOT_SYNCED: 'NOT_SYNCED' as const,
+ ONGOING: 'ONGOING' as const,
+ ACTIVE: 'ACTIVE' as const,
+ FAILED_INSUFFICIENT_PERMISSIONS: 'FAILED_INSUFFICIENT_PERMISSIONS' as const,
+ FAILED_UNKNOWN: 'FAILED_UNKNOWN' as const
+}
+
+export const enumCalendarChannelSyncStage = {
+ PENDING_CONFIGURATION: 'PENDING_CONFIGURATION' as const,
+ CALENDAR_EVENT_LIST_FETCH_PENDING: 'CALENDAR_EVENT_LIST_FETCH_PENDING' as const,
+ CALENDAR_EVENT_LIST_FETCH_SCHEDULED: 'CALENDAR_EVENT_LIST_FETCH_SCHEDULED' as const,
+ CALENDAR_EVENT_LIST_FETCH_ONGOING: 'CALENDAR_EVENT_LIST_FETCH_ONGOING' as const,
+ CALENDAR_EVENTS_IMPORT_PENDING: 'CALENDAR_EVENTS_IMPORT_PENDING' as const,
+ CALENDAR_EVENTS_IMPORT_SCHEDULED: 'CALENDAR_EVENTS_IMPORT_SCHEDULED' as const,
+ CALENDAR_EVENTS_IMPORT_ONGOING: 'CALENDAR_EVENTS_IMPORT_ONGOING' as const,
+ FAILED: 'FAILED' as const
+}
+
+export const enumCalendarChannelVisibility = {
+ METADATA: 'METADATA' as const,
+ SHARE_EVERYTHING: 'SHARE_EVERYTHING' as const
+}
+
+export const enumCalendarChannelContactAutoCreationPolicy = {
+ AS_PARTICIPANT_AND_ORGANIZER: 'AS_PARTICIPANT_AND_ORGANIZER' as const,
+ AS_PARTICIPANT: 'AS_PARTICIPANT' as const,
+ AS_ORGANIZER: 'AS_ORGANIZER' as const,
+ NONE: 'NONE' as const
+}
+
export const enumMessageFolderPendingSyncAction = {
FOLDER_DELETION: 'FOLDER_DELETION' as const,
NONE: 'NONE' as const
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index ec1de81611b..a05cba88c84 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -42,44 +42,45 @@ export default {
104,
110,
124,
- 131,
+ 134,
+ 135,
+ 136,
138,
- 139,
- 140,
- 142,
- 150,
- 161,
- 164,
+ 146,
+ 157,
+ 160,
+ 162,
166,
- 170,
- 172,
- 177,
- 178,
- 185,
- 188,
- 191,
- 204,
- 219,
- 231,
- 305,
- 306,
- 307,
- 308,
- 310,
- 311,
- 312,
- 313,
- 314,
- 315,
- 316,
+ 168,
+ 173,
+ 174,
+ 181,
+ 184,
+ 187,
+ 200,
+ 215,
+ 227,
+ 266,
+ 268,
+ 269,
+ 270,
+ 271,
+ 272,
+ 273,
+ 274,
+ 281,
319,
+ 320,
321,
- 331,
- 338,
- 345,
- 463,
- 468,
- 476
+ 322,
+ 324,
+ 326,
+ 337,
+ 344,
+ 351,
+ 473,
+ 478,
+ 486
],
"types": {
"BillingProductDTO": {
@@ -93,13 +94,13 @@ export default {
1
],
"metadata": [
- 137
+ 133
],
"on_BillingLicensedProduct": [
- 146
+ 142
],
"on_BillingMeteredProduct": [
- 147
+ 143
],
"__typename": [
1
@@ -959,10 +960,10 @@ export default {
3
],
"relation": [
- 203
+ 199
],
"morphRelations": [
- 203
+ 199
],
"object": [
56
@@ -1024,7 +1025,7 @@ export default {
46
],
"objectMetadata": [
- 211,
+ 207,
{
"paging": [
49,
@@ -1037,7 +1038,7 @@ export default {
}
],
"indexFieldMetadatas": [
- 209,
+ 205,
{
"paging": [
49,
@@ -1291,7 +1292,7 @@ export default {
47
],
"fields": [
- 216,
+ 212,
{
"paging": [
49,
@@ -1304,7 +1305,7 @@ export default {
}
],
"indexMetadatas": [
- 214,
+ 210,
{
"paging": [
49,
@@ -1900,19 +1901,19 @@ export default {
59
],
"featureFlags": [
- 171
+ 167
],
"billingSubscriptions": [
- 149
+ 145
],
"installedApplications": [
59
],
"currentBillingSubscription": [
- 149
+ 145
],
"billingEntitlements": [
- 230
+ 226
],
"hasValidSignedEnterpriseKey": [
6
@@ -1921,7 +1922,7 @@ export default {
6
],
"workspaceUrls": [
- 173
+ 169
],
"workspaceCustomApplicationId": [
1
@@ -2010,7 +2011,7 @@ export default {
20
],
"deletedWorkspaceMembers": [
- 229
+ 225
],
"hasPassword": [
6
@@ -2022,7 +2023,7 @@ export default {
17
],
"availableWorkspaces": [
- 228
+ 224
],
"__typename": [
1
@@ -2861,58 +2862,6 @@ export default {
1
]
},
- "VerificationRecord": {
- "type": [
- 1
- ],
- "key": [
- 1
- ],
- "value": [
- 1
- ],
- "priority": [
- 11
- ],
- "__typename": [
- 1
- ]
- },
- "EmailingDomain": {
- "id": [
- 3
- ],
- "createdAt": [
- 4
- ],
- "updatedAt": [
- 4
- ],
- "domain": [
- 1
- ],
- "status": [
- 131
- ],
- "verificationRecords": [
- 129
- ],
- "verifiedAt": [
- 4
- ],
- "__typename": [
- 1
- ]
- },
- "EmailingDomainStatus": {},
- "SendEmailViaDomainOutput": {
- "messageId": [
- 1
- ],
- "__typename": [
- 1
- ]
- },
"ApprovedAccessDomain": {
"id": [
3
@@ -2969,7 +2918,7 @@ export default {
11
],
"items": [
- 135
+ 131
],
"__typename": [
1
@@ -2977,13 +2926,13 @@ export default {
},
"BillingProductMetadata": {
"planKey": [
- 138
+ 134
],
"priceUsageBased": [
- 139
+ 135
],
"productKey": [
- 140
+ 136
],
"__typename": [
1
@@ -2994,7 +2943,7 @@ export default {
"BillingProductKey": {},
"BillingPriceLicensed": {
"recurringInterval": [
- 142
+ 138
],
"unitAmount": [
11
@@ -3003,7 +2952,7 @@ export default {
1
],
"priceUsageType": [
- 139
+ 135
],
"creditAmount": [
11
@@ -3029,16 +2978,16 @@ export default {
},
"BillingPriceMetered": {
"tiers": [
- 143
+ 139
],
"recurringInterval": [
- 142
+ 138
],
"stripePriceId": [
1
],
"priceUsageType": [
- 139
+ 135
],
"__typename": [
1
@@ -3055,7 +3004,7 @@ export default {
1
],
"metadata": [
- 137
+ 133
],
"__typename": [
1
@@ -3072,10 +3021,10 @@ export default {
1
],
"metadata": [
- 137
+ 133
],
"prices": [
- 141
+ 137
],
"__typename": [
1
@@ -3092,10 +3041,10 @@ export default {
1
],
"metadata": [
- 137
+ 133
],
"prices": [
- 144
+ 140
],
"__typename": [
1
@@ -3126,13 +3075,13 @@ export default {
3
],
"status": [
- 150
+ 146
],
"interval": [
- 142
+ 138
],
"billingSubscriptionItems": [
- 148
+ 144
],
"currentPeriodEnd": [
4
@@ -3141,7 +3090,7 @@ export default {
15
],
"phases": [
- 136
+ 132
],
"__typename": [
1
@@ -3150,7 +3099,7 @@ export default {
"SubscriptionStatus": {},
"BillingEndTrialPeriod": {
"status": [
- 150
+ 146
],
"hasPaymentMethod": [
6
@@ -3164,7 +3113,7 @@ export default {
},
"BillingResourceCreditUsage": {
"productKey": [
- 140
+ 136
],
"periodStart": [
4
@@ -3193,16 +3142,16 @@ export default {
},
"BillingPlan": {
"planKey": [
- 138
+ 134
],
"baseProducts": [
- 146
+ 142
],
"resourceCreditProducts": [
- 146
+ 142
],
"meteredProducts": [
- 147
+ 143
],
"__typename": [
1
@@ -3218,10 +3167,10 @@ export default {
},
"BillingUpdate": {
"currentBillingSubscription": [
- 149
+ 145
],
"billingSubscriptions": [
- 149
+ 145
],
"__typename": [
1
@@ -3260,7 +3209,7 @@ export default {
1
],
"result": [
- 157
+ 153
],
"__typename": [
1
@@ -3297,7 +3246,7 @@ export default {
3
],
"type": [
- 161
+ 157
],
"name": [
1
@@ -3330,7 +3279,7 @@ export default {
4
],
"targetRecordIdentifier": [
- 159
+ 155
],
"__typename": [
1
@@ -3356,7 +3305,7 @@ export default {
},
"MetadataEvent": {
"type": [
- 164
+ 160
],
"metadataName": [
1
@@ -3365,7 +3314,7 @@ export default {
1
],
"properties": [
- 162
+ 158
],
"updatedCollectionHash": [
1
@@ -3377,7 +3326,7 @@ export default {
"MetadataEventAction": {},
"ObjectRecordEvent": {
"action": [
- 166
+ 162
],
"objectNameSingular": [
1
@@ -3392,7 +3341,7 @@ export default {
1
],
"properties": [
- 162
+ 158
],
"__typename": [
1
@@ -3404,7 +3353,7 @@ export default {
1
],
"objectRecordEvent": [
- 165
+ 161
],
"__typename": [
1
@@ -3415,10 +3364,10 @@ export default {
1
],
"objectRecordEventsWithQueryIds": [
- 167
+ 163
],
"metadataEvents": [
- 163
+ 159
],
"__typename": [
1
@@ -3435,7 +3384,7 @@ export default {
11
],
"status": [
- 170
+ 166
],
"error": [
15
@@ -3447,7 +3396,7 @@ export default {
"LogicFunctionExecutionStatus": {},
"FeatureFlag": {
"key": [
- 172
+ 168
],
"value": [
6
@@ -3519,10 +3468,10 @@ export default {
1
],
"type": [
- 177
+ 173
],
"status": [
- 178
+ 174
],
"issuer": [
1
@@ -3535,7 +3484,7 @@ export default {
"SSOIdentityProviderStatus": {},
"AuthProviders": {
"sso": [
- 176
+ 172
],
"google": [
6
@@ -3572,10 +3521,10 @@ export default {
3
],
"authProviders": [
- 179
+ 175
],
"authBypassProviders": [
- 180
+ 176
],
"logo": [
1
@@ -3584,7 +3533,7 @@ export default {
1
],
"workspaceUrls": [
- 173
+ 169
],
"__typename": [
1
@@ -3623,7 +3572,7 @@ export default {
1
],
"modelFamily": [
- 185
+ 181
],
"modelFamilyLabel": [
1
@@ -3638,7 +3587,7 @@ export default {
11
],
"nativeCapabilities": [
- 183
+ 179
],
"isDeprecated": [
6
@@ -3674,7 +3623,7 @@ export default {
1
],
"trialPeriods": [
- 175
+ 171
],
"__typename": [
1
@@ -3682,7 +3631,7 @@ export default {
},
"Support": {
"supportDriver": [
- 188
+ 184
],
"supportFrontChatId": [
1
@@ -3708,7 +3657,7 @@ export default {
},
"Captcha": {
"provider": [
- 191
+ 187
],
"siteKey": [
1
@@ -3742,10 +3691,10 @@ export default {
},
"PublicFeatureFlag": {
"key": [
- 172
+ 168
],
"metadata": [
- 193
+ 189
],
"__typename": [
1
@@ -3770,13 +3719,13 @@ export default {
1
],
"authProviders": [
- 179
+ 175
],
"billing": [
- 186
+ 182
],
"aiModels": [
- 184
+ 180
],
"signInPrefilled": [
6
@@ -3797,25 +3746,25 @@ export default {
6
],
"support": [
- 187
+ 183
],
"isAttachmentPreviewEnabled": [
6
],
"sentry": [
- 189
+ 185
],
"captcha": [
- 190
+ 186
],
"api": [
- 192
+ 188
],
"canManageFeatureFlags": [
6
],
"publicFeatureFlags": [
- 194
+ 190
],
"isMicrosoftMessagingEnabled": [
6
@@ -3835,7 +3784,7 @@ export default {
"isImapSmtpCaldavEnabled": [
6
],
- "isEmailGroupEnabled": [
+ "isEmailingDomainInDemoMode": [
6
],
"allowRequestsToTwentyIcons": [
@@ -3854,7 +3803,7 @@ export default {
6
],
"maintenance": [
- 195
+ 191
],
"__typename": [
1
@@ -3893,7 +3842,7 @@ export default {
1
],
"versionDistribution": [
- 198
+ 194
],
"__typename": [
1
@@ -3940,7 +3889,7 @@ export default {
},
"Relation": {
"type": [
- 204
+ 200
],
"sourceObjectMetadata": [
56
@@ -3989,10 +3938,10 @@ export default {
},
"IndexConnection": {
"pageInfo": [
- 206
+ 202
],
"edges": [
- 205
+ 201
],
"__typename": [
1
@@ -4011,10 +3960,10 @@ export default {
},
"IndexIndexFieldMetadatasConnection": {
"pageInfo": [
- 206
+ 202
],
"edges": [
- 208
+ 204
],
"__typename": [
1
@@ -4033,10 +3982,10 @@ export default {
},
"IndexObjectMetadataConnection": {
"pageInfo": [
- 206
+ 202
],
"edges": [
- 210
+ 206
],
"__typename": [
1
@@ -4055,10 +4004,10 @@ export default {
},
"ObjectConnection": {
"pageInfo": [
- 206
+ 202
],
"edges": [
- 210
+ 206
],
"__typename": [
1
@@ -4066,10 +4015,10 @@ export default {
},
"ObjectIndexMetadatasConnection": {
"pageInfo": [
- 206
+ 202
],
"edges": [
- 205
+ 201
],
"__typename": [
1
@@ -4088,10 +4037,10 @@ export default {
},
"ObjectFieldsConnection": {
"pageInfo": [
- 206
+ 202
],
"edges": [
- 215
+ 211
],
"__typename": [
1
@@ -4099,10 +4048,10 @@ export default {
},
"FieldConnection": {
"pageInfo": [
- 206
+ 202
],
"edges": [
- 215
+ 211
],
"__typename": [
1
@@ -4110,7 +4059,7 @@ export default {
},
"AppConnection": {
"id": [
- 219
+ 215
],
"providerName": [
1
@@ -4162,7 +4111,7 @@ export default {
3
],
"type": [
- 177
+ 173
],
"issuer": [
1
@@ -4171,7 +4120,7 @@ export default {
1
],
"status": [
- 178
+ 174
],
"__typename": [
1
@@ -4190,7 +4139,7 @@ export default {
},
"FindAvailableSSOIDP": {
"type": [
- 177
+ 173
],
"id": [
3
@@ -4202,10 +4151,10 @@ export default {
1
],
"status": [
- 178
+ 174
],
"workspace": [
- 223
+ 219
],
"__typename": [
1
@@ -4216,7 +4165,7 @@ export default {
3
],
"type": [
- 177
+ 173
],
"issuer": [
1
@@ -4225,7 +4174,7 @@ export default {
1
],
"status": [
- 178
+ 174
],
"__typename": [
1
@@ -4233,7 +4182,7 @@ export default {
},
"SSOConnection": {
"type": [
- 177
+ 173
],
"id": [
3
@@ -4245,7 +4194,7 @@ export default {
1
],
"status": [
- 178
+ 174
],
"__typename": [
1
@@ -4268,13 +4217,13 @@ export default {
1
],
"workspaceUrls": [
- 173
+ 169
],
"logo": [
1
],
"sso": [
- 226
+ 222
],
"__typename": [
1
@@ -4282,10 +4231,10 @@ export default {
},
"AvailableWorkspaces": {
"availableWorkspacesForSignIn": [
- 227
+ 223
],
"availableWorkspacesForSignUp": [
- 227
+ 223
],
"__typename": [
1
@@ -4313,7 +4262,7 @@ export default {
},
"BillingEntitlement": {
"key": [
- 231
+ 227
],
"value": [
6
@@ -4351,7 +4300,7 @@ export default {
1
],
"records": [
- 232
+ 228
],
"__typename": [
1
@@ -4395,13 +4344,13 @@ export default {
},
"PublicImapSmtpCaldavConnectionParameters": {
"IMAP": [
- 236
+ 232
],
"SMTP": [
- 236
+ 232
],
"CALDAV": [
- 236
+ 232
],
"__typename": [
1
@@ -4457,7 +4406,7 @@ export default {
4
],
"connectionParameters": [
- 237
+ 233
],
"__typename": [
1
@@ -4508,10 +4457,10 @@ export default {
},
"AvailableWorkspacesAndAccessTokens": {
"tokens": [
- 243
+ 239
],
"availableWorkspaces": [
- 228
+ 224
],
"__typename": [
1
@@ -4549,7 +4498,7 @@ export default {
},
"WorkspaceUrlsAndId": {
"workspaceUrls": [
- 173
+ 169
],
"id": [
3
@@ -4563,7 +4512,7 @@ export default {
32
],
"workspace": [
- 248
+ 244
],
"__typename": [
1
@@ -4596,7 +4545,7 @@ export default {
32
],
"workspaceUrls": [
- 173
+ 169
],
"__typename": [
1
@@ -4612,7 +4561,7 @@ export default {
},
"AuthTokens": {
"tokens": [
- 243
+ 239
],
"__typename": [
1
@@ -4653,7 +4602,7 @@ export default {
32
],
"workspace": [
- 248
+ 244
],
"__typename": [
1
@@ -4675,7 +4624,7 @@ export default {
1
],
"dailyUsage": [
- 259
+ 255
],
"__typename": [
1
@@ -4683,16 +4632,16 @@ export default {
},
"UsageAnalytics": {
"usageByUser": [
- 197
+ 193
],
"usageByOperationType": [
- 197
+ 193
],
"usageByModel": [
- 197
+ 193
],
"timeSeries": [
- 259
+ 255
],
"periodStart": [
4
@@ -4701,7 +4650,7 @@ export default {
4
],
"userDailyUsage": [
- 260
+ 256
],
"__typename": [
1
@@ -4827,53 +4776,266 @@ export default {
1
]
},
- "AutocompleteResult": {
- "text": [
+ "VerificationRecord": {
+ "type": [
1
],
- "placeId": [
+ "key": [
1
],
- "__typename": [
+ "value": [
1
- ]
- },
- "Location": {
- "lat": [
- 11
],
- "lng": [
+ "priority": [
11
],
"__typename": [
1
]
},
- "PlaceDetailsResult": {
- "street": [
- 1
+ "EmailingDomain": {
+ "id": [
+ 3
],
- "state": [
- 1
+ "createdAt": [
+ 4
],
- "postcode": [
- 1
+ "updatedAt": [
+ 4
],
- "city": [
+ "domain": [
1
],
- "country": [
- 1
+ "status": [
+ 266
],
- "location": [
- 269
+ "verificationRecords": [
+ 264
+ ],
+ "verifiedAt": [
+ 4
],
"__typename": [
1
]
},
- "ImapSmtpCaldavPublicConnectionParams": {
- "host": [
+ "EmailingDomainStatus": {},
+ "MessageChannel": {
+ "id": [
+ 3
+ ],
+ "visibility": [
+ 268
+ ],
+ "handle": [
+ 1
+ ],
+ "type": [
+ 269
+ ],
+ "isContactAutoCreationEnabled": [
+ 6
+ ],
+ "contactAutoCreationPolicy": [
+ 270
+ ],
+ "messageFolderImportPolicy": [
+ 271
+ ],
+ "excludeNonProfessionalEmails": [
+ 6
+ ],
+ "excludeGroupEmails": [
+ 6
+ ],
+ "pendingGroupEmailsAction": [
+ 272
+ ],
+ "isSyncEnabled": [
+ 6
+ ],
+ "syncedAt": [
+ 4
+ ],
+ "syncStatus": [
+ 273
+ ],
+ "syncStage": [
+ 274
+ ],
+ "syncStageStartedAt": [
+ 4
+ ],
+ "throttleFailureCount": [
+ 11
+ ],
+ "throttleRetryAfter": [
+ 4
+ ],
+ "connectedAccountId": [
+ 3
+ ],
+ "createdAt": [
+ 4
+ ],
+ "updatedAt": [
+ 4
+ ],
+ "connectedAccount": [
+ 234
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "MessageChannelVisibility": {},
+ "MessageChannelType": {},
+ "MessageChannelContactAutoCreationPolicy": {},
+ "MessageFolderImportPolicy": {},
+ "MessageChannelPendingGroupEmailsAction": {},
+ "MessageChannelSyncStatus": {},
+ "MessageChannelSyncStage": {},
+ "CreateEmailGroupChannelOutput": {
+ "messageChannel": [
+ 267
+ ],
+ "forwardingAddress": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "CampaignAudiencePreviewDTO": {
+ "totalMembers": [
+ 21
+ ],
+ "withoutEmail": [
+ 21
+ ],
+ "duplicateEmails": [
+ 21
+ ],
+ "globallyUnsubscribed": [
+ 21
+ ],
+ "topicUnsubscribed": [
+ 21
+ ],
+ "sendable": [
+ 21
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "SendEmailViaDomainOutput": {
+ "messageId": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "CampaignSkippedRecipientsDTO": {
+ "noEmail": [
+ 21
+ ],
+ "deduped": [
+ 21
+ ],
+ "overCap": [
+ 21
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "SendMessageCampaignOutputDTO": {
+ "campaignId": [
+ 1
+ ],
+ "queuedCount": [
+ 21
+ ],
+ "skipped": [
+ 278
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "UnsubscribeTopic": {
+ "id": [
+ 3
+ ],
+ "createdAt": [
+ 4
+ ],
+ "updatedAt": [
+ 4
+ ],
+ "name": [
+ 1
+ ],
+ "description": [
+ 1
+ ],
+ "visibility": [
+ 281
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "UnsubscribeTopicVisibility": {},
+ "AutocompleteResult": {
+ "text": [
+ 1
+ ],
+ "placeId": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "Location": {
+ "lat": [
+ 11
+ ],
+ "lng": [
+ 11
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "PlaceDetailsResult": {
+ "street": [
+ 1
+ ],
+ "state": [
+ 1
+ ],
+ "postcode": [
+ 1
+ ],
+ "city": [
+ 1
+ ],
+ "country": [
+ 1
+ ],
+ "location": [
+ 283
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "ImapSmtpCaldavPublicConnectionParams": {
+ "host": [
1
],
"port": [
@@ -4891,13 +5053,13 @@ export default {
},
"ImapSmtpCaldavPublicConnectionParameters": {
"IMAP": [
- 271
+ 285
],
"SMTP": [
- 271
+ 285
],
"CALDAV": [
- 271
+ 285
],
"__typename": [
1
@@ -4917,7 +5079,7 @@ export default {
3
],
"connectionParameters": [
- 272
+ 286
],
"__typename": [
1
@@ -5119,7 +5281,7 @@ export default {
1
],
"series": [
- 280
+ 294
],
"xAxisLabel": [
1
@@ -5168,7 +5330,7 @@ export default {
1
],
"data": [
- 282
+ 296
],
"__typename": [
1
@@ -5176,7 +5338,7 @@ export default {
},
"LineChartData": {
"series": [
- 283
+ 297
],
"xAxisLabel": [
1
@@ -5213,7 +5375,7 @@ export default {
},
"PieChartData": {
"data": [
- 285
+ 299
],
"showLegend": [
6
@@ -5315,13 +5477,13 @@ export default {
},
"EventLogQueryResult": {
"records": [
- 290
+ 304
],
"totalCount": [
21
],
"pageInfo": [
- 291
+ 305
],
"__typename": [
1
@@ -5385,7 +5547,7 @@ export default {
1
],
"parts": [
- 277
+ 291
],
"processedAt": [
4
@@ -5399,7 +5561,7 @@ export default {
},
"AgentChatThread": {
"id": [
- 219
+ 215
],
"title": [
1
@@ -5454,7 +5616,7 @@ export default {
},
"AiSystemPromptPreview": {
"sections": [
- 296
+ 310
],
"estimatedTokenCount": [
21
@@ -5530,10 +5692,10 @@ export default {
3
],
"evaluations": [
- 301
+ 315
],
"messages": [
- 294
+ 308
],
"createdAt": [
4
@@ -5564,19 +5726,19 @@ export default {
1
],
"syncStatus": [
- 305
+ 319
],
"syncStage": [
- 306
+ 320
],
"visibility": [
- 307
+ 321
],
"isContactAutoCreationEnabled": [
6
],
"contactAutoCreationPolicy": [
- 308
+ 322
],
"isSyncEnabled": [
6
@@ -5607,92 +5769,6 @@ export default {
"CalendarChannelSyncStage": {},
"CalendarChannelVisibility": {},
"CalendarChannelContactAutoCreationPolicy": {},
- "MessageChannel": {
- "id": [
- 3
- ],
- "visibility": [
- 310
- ],
- "handle": [
- 1
- ],
- "type": [
- 311
- ],
- "isContactAutoCreationEnabled": [
- 6
- ],
- "contactAutoCreationPolicy": [
- 312
- ],
- "messageFolderImportPolicy": [
- 313
- ],
- "excludeNonProfessionalEmails": [
- 6
- ],
- "excludeGroupEmails": [
- 6
- ],
- "pendingGroupEmailsAction": [
- 314
- ],
- "isSyncEnabled": [
- 6
- ],
- "syncedAt": [
- 4
- ],
- "syncStatus": [
- 315
- ],
- "syncStage": [
- 316
- ],
- "syncStageStartedAt": [
- 4
- ],
- "throttleFailureCount": [
- 11
- ],
- "throttleRetryAfter": [
- 4
- ],
- "connectedAccountId": [
- 3
- ],
- "createdAt": [
- 4
- ],
- "updatedAt": [
- 4
- ],
- "connectedAccount": [
- 238
- ],
- "__typename": [
- 1
- ]
- },
- "MessageChannelVisibility": {},
- "MessageChannelType": {},
- "MessageChannelContactAutoCreationPolicy": {},
- "MessageFolderImportPolicy": {},
- "MessageChannelPendingGroupEmailsAction": {},
- "MessageChannelSyncStatus": {},
- "MessageChannelSyncStage": {},
- "CreateEmailGroupChannelOutput": {
- "messageChannel": [
- 309
- ],
- "forwardingAddress": [
- 1
- ],
- "__typename": [
- 1
- ]
- },
"MessageFolder": {
"id": [
3
@@ -5713,7 +5789,7 @@ export default {
1
],
"pendingSyncAction": [
- 319
+ 324
],
"messageChannelId": [
3
@@ -5731,7 +5807,7 @@ export default {
"MessageFolderPendingSyncAction": {},
"CollectionHash": {
"collectionName": [
- 321
+ 326
],
"hash": [
1
@@ -5798,13 +5874,13 @@ export default {
},
"MinimalMetadata": {
"objectMetadataItems": [
- 322
+ 327
],
"views": [
- 323
+ 328
],
"collectionHashes": [
- 320
+ 325
],
"__typename": [
1
@@ -5812,10 +5888,10 @@ export default {
},
"Query": {
"navigationMenuItems": [
- 160
+ 156
],
"navigationMenuItem": [
- 160,
+ 156,
{
"id": [
3,
@@ -5957,13 +6033,13 @@ export default {
2,
{
"input": [
- 326,
+ 331,
"GetApiKeyInput!"
]
}
],
"billingPortalSession": [
- 154,
+ 150,
{
"returnUrlPath": [
1
@@ -5971,16 +6047,16 @@ export default {
}
],
"listPlans": [
- 153
+ 149
],
"getResourceCreditUsage": [
- 152
+ 148
],
"findWorkspaceInvitations": [
- 157
+ 153
],
"getApprovedAccessDomains": [
- 133
+ 129
],
"getPageLayoutTabs": [
122,
@@ -6020,9 +6096,6 @@ export default {
]
}
],
- "getEmailingDomains": [
- 130
- ],
"applicationConnectionProviders": [
126,
{
@@ -6054,7 +6127,7 @@ export default {
41,
{
"input": [
- 327,
+ 332,
"LogicFunctionIdInput!"
]
}
@@ -6066,7 +6139,7 @@ export default {
15,
{
"input": [
- 327,
+ 332,
"LogicFunctionIdInput!"
]
}
@@ -6075,7 +6148,7 @@ export default {
1,
{
"input": [
- 327,
+ 332,
"LogicFunctionIdInput!"
]
}
@@ -6105,7 +6178,7 @@ export default {
}
],
"objectRecordCounts": [
- 212
+ 208
],
"object": [
56,
@@ -6117,7 +6190,7 @@ export default {
}
],
"objects": [
- 213,
+ 209,
{
"paging": [
49,
@@ -6139,7 +6212,7 @@ export default {
}
],
"indexMetadatas": [
- 207,
+ 203,
{
"paging": [
49,
@@ -6158,16 +6231,45 @@ export default {
25,
{
"input": [
- 328,
+ 333,
"AgentIdInput!"
]
}
],
+ "previewMessageCampaignAudience": [
+ 276,
+ {
+ "input": [
+ 334,
+ "PreviewMessageCampaignAudienceInput!"
+ ]
+ }
+ ],
+ "unsubscribeTopics": [
+ 280
+ ],
+ "unsubscribePagePreviewUrl": [
+ 1
+ ],
+ "myMessageChannels": [
+ 267,
+ {
+ "connectedAccountId": [
+ 3
+ ]
+ }
+ ],
+ "getEmailingDomains": [
+ 265
+ ],
+ "myConnectedAccounts": [
+ 234
+ ],
"getRoles": [
29
],
"getToolIndex": [
- 276
+ 290
],
"getToolInputSchema": [
15,
@@ -6179,10 +6281,10 @@ export default {
}
],
"webhooks": [
- 275
+ 289
],
"webhook": [
- 275,
+ 289,
{
"id": [
3,
@@ -6200,7 +6302,7 @@ export default {
}
],
"fields": [
- 217,
+ 213,
{
"paging": [
49,
@@ -6230,26 +6332,15 @@ export default {
}
],
"myMessageFolders": [
- 318,
+ 323,
{
"messageChannelId": [
3
]
}
],
- "myMessageChannels": [
- 309,
- {
- "connectedAccountId": [
- 3
- ]
- }
- ],
- "myConnectedAccounts": [
- 238
- ],
"myCalendarChannels": [
- 304,
+ 318,
{
"connectedAccountId": [
3
@@ -6257,33 +6348,33 @@ export default {
}
],
"minimalMetadata": [
- 324
+ 329
],
"appConnections": [
- 218,
+ 214,
{
"filter": [
- 329
+ 335
]
}
],
"appConnection": [
- 218,
+ 214,
{
"id": [
- 219,
+ 215,
"ID!"
]
}
],
"findWorkspaceAiStats": [
- 303
+ 317
],
"chatThreads": [
- 295
+ 309
],
"chatThread": [
- 295,
+ 309,
{
"id": [
3,
@@ -6292,7 +6383,7 @@ export default {
}
],
"chatMessages": [
- 294,
+ 308,
{
"threadId": [
3,
@@ -6301,7 +6392,7 @@ export default {
}
],
"chatStreamCatchupChunks": [
- 298,
+ 312,
{
"threadId": [
3,
@@ -6310,13 +6401,13 @@ export default {
}
],
"getAiSystemPromptPreview": [
- 297
+ 311
],
"skills": [
- 293
+ 307
],
"skill": [
- 293,
+ 307,
{
"id": [
3,
@@ -6325,7 +6416,7 @@ export default {
}
],
"agentTurns": [
- 302,
+ 316,
{
"agentId": [
3,
@@ -6334,7 +6425,7 @@ export default {
}
],
"checkUserExists": [
- 256,
+ 252,
{
"email": [
1,
@@ -6346,7 +6437,7 @@ export default {
}
],
"checkWorkspaceInviteHashIsValid": [
- 257,
+ 253,
{
"inviteHash": [
1,
@@ -6364,7 +6455,7 @@ export default {
}
],
"validatePasswordResetToken": [
- 251,
+ 247,
{
"passwordResetToken": [
1,
@@ -6373,7 +6464,7 @@ export default {
}
],
"findApplicationRegistrationByClientId": [
- 201,
+ 197,
{
"clientId": [
1,
@@ -6403,7 +6494,7 @@ export default {
}
],
"findApplicationRegistrationStats": [
- 199,
+ 195,
{
"id": [
1,
@@ -6412,7 +6503,7 @@ export default {
}
],
"findApplicationRegistrationVariables": [
- 174,
+ 170,
{
"applicationRegistrationId": [
1,
@@ -6436,7 +6527,7 @@ export default {
76
],
"getPublicWorkspaceDataByDomain": [
- 181,
+ 177,
{
"origin": [
1
@@ -6444,7 +6535,7 @@ export default {
}
],
"getPublicWorkspaceDataById": [
- 182,
+ 178,
{
"id": [
3,
@@ -6467,46 +6558,46 @@ export default {
}
],
"getSSOIdentityProviders": [
- 224
+ 220
],
"eventLogs": [
- 292,
+ 306,
{
"input": [
- 330,
+ 336,
"EventLogQueryInput!"
]
}
],
"pieChartData": [
- 286,
+ 300,
{
"input": [
- 334,
+ 340,
"PieChartDataInput!"
]
}
],
"lineChartData": [
- 284,
+ 298,
{
"input": [
- 335,
+ 341,
"LineChartDataInput!"
]
}
],
"barChartData": [
- 281,
+ 295,
{
"input": [
- 336,
+ 342,
"BarChartDataInput!"
]
}
],
"getConnectedImapSmtpCaldavAccount": [
- 273,
+ 287,
{
"id": [
3,
@@ -6515,7 +6606,7 @@ export default {
}
],
"getAutoCompleteAddress": [
- 268,
+ 282,
{
"address": [
1,
@@ -6534,7 +6625,7 @@ export default {
}
],
"getAddressDetails": [
- 270,
+ 284,
{
"placeId": [
1,
@@ -6547,21 +6638,21 @@ export default {
}
],
"getUsageAnalytics": [
- 261,
+ 257,
{
"input": [
- 337
+ 343
]
}
],
"findManyPublicDomains": [
- 267
+ 263
],
"findManyMarketplaceApps": [
- 265
+ 261
],
"findMarketplaceAppDetail": [
- 266,
+ 262,
{
"universalIdentifier": [
1,
@@ -6583,7 +6674,7 @@ export default {
},
"LogicFunctionIdInput": {
"id": [
- 219
+ 215
],
"__typename": [
1
@@ -6597,6 +6688,17 @@ export default {
1
]
},
+ "PreviewMessageCampaignAudienceInput": {
+ "listId": [
+ 1
+ ],
+ "unsubscribeTopicId": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
"ListAppConnectionsInput": {
"providerName": [
1
@@ -6613,10 +6715,10 @@ export default {
},
"EventLogQueryInput": {
"table": [
- 331
+ 337
],
"filters": [
- 332
+ 338
],
"first": [
21
@@ -6637,7 +6739,7 @@ export default {
1
],
"dateRange": [
- 333
+ 339
],
"recordId": [
1
@@ -6704,7 +6806,7 @@ export default {
1
],
"operationTypes": [
- 338
+ 344
],
"__typename": [
1
@@ -6716,7 +6818,7 @@ export default {
6,
{
"input": [
- 340,
+ 346,
"AddQuerySubscriptionInput!"
]
}
@@ -6725,49 +6827,49 @@ export default {
6,
{
"input": [
- 341,
+ 347,
"RemoveQueryFromEventStreamInput!"
]
}
],
"createManyNavigationMenuItems": [
- 160,
+ 156,
{
"inputs": [
- 342,
+ 348,
"[CreateNavigationMenuItemInput!]!"
]
}
],
"createNavigationMenuItem": [
- 160,
+ 156,
{
"input": [
- 342,
+ 348,
"CreateNavigationMenuItemInput!"
]
}
],
"updateManyNavigationMenuItems": [
- 160,
+ 156,
{
"inputs": [
- 343,
+ 349,
"[UpdateOneNavigationMenuItemInput!]!"
]
}
],
"updateNavigationMenuItem": [
- 160,
+ 156,
{
"input": [
- 343,
+ 349,
"UpdateOneNavigationMenuItemInput!"
]
}
],
"deleteManyNavigationMenuItems": [
- 160,
+ 156,
{
"ids": [
3,
@@ -6776,7 +6878,7 @@ export default {
}
],
"deleteNavigationMenuItem": [
- 160,
+ 156,
{
"id": [
3,
@@ -6785,10 +6887,10 @@ export default {
}
],
"uploadEmailAttachmentFile": [
- 134,
+ 130,
{
"file": [
- 345,
+ 351,
"Upload!"
]
}
@@ -6806,46 +6908,46 @@ export default {
}
],
"uploadAiChatFile": [
- 134,
+ 130,
{
"file": [
- 345,
+ 351,
"Upload!"
]
}
],
"uploadWorkflowFile": [
- 134,
+ 130,
{
"file": [
- 345,
+ 351,
"Upload!"
]
}
],
"uploadWorkspaceLogo": [
- 134,
+ 130,
{
"file": [
- 345,
+ 351,
"Upload!"
]
}
],
"uploadWorkspaceMemberProfilePicture": [
- 134,
+ 130,
{
"file": [
- 345,
+ 351,
"Upload!"
]
}
],
"uploadFilesFieldFile": [
- 134,
+ 130,
{
"file": [
- 345,
+ 351,
"Upload!"
],
"fieldMetadataId": [
@@ -6855,10 +6957,10 @@ export default {
}
],
"uploadFilesFieldFileByUniversalIdentifier": [
- 134,
+ 130,
{
"file": [
- 345,
+ 351,
"Upload!"
],
"fieldMetadataUniversalIdentifier": [
@@ -6871,7 +6973,7 @@ export default {
62,
{
"input": [
- 346,
+ 352,
"CreateViewFilterGroupInput!"
]
}
@@ -6884,7 +6986,7 @@ export default {
"String!"
],
"input": [
- 347,
+ 353,
"UpdateViewFilterGroupInput!"
]
}
@@ -6911,7 +7013,7 @@ export default {
64,
{
"input": [
- 348,
+ 354,
"CreateViewFilterInput!"
]
}
@@ -6920,7 +7022,7 @@ export default {
64,
{
"input": [
- 349,
+ 355,
"UpdateViewFilterInput!"
]
}
@@ -6929,7 +7031,7 @@ export default {
64,
{
"input": [
- 351,
+ 357,
"DeleteViewFilterInput!"
]
}
@@ -6938,7 +7040,7 @@ export default {
64,
{
"input": [
- 352,
+ 358,
"DestroyViewFilterInput!"
]
}
@@ -6947,7 +7049,7 @@ export default {
70,
{
"input": [
- 353,
+ 359,
"CreateViewInput!"
]
}
@@ -6960,7 +7062,7 @@ export default {
"String!"
],
"input": [
- 354,
+ 360,
"UpdateViewInput!"
]
}
@@ -6987,7 +7089,7 @@ export default {
70,
{
"input": [
- 355,
+ 361,
"UpsertViewWidgetInput!"
]
}
@@ -6996,7 +7098,7 @@ export default {
67,
{
"input": [
- 360,
+ 366,
"CreateViewSortInput!"
]
}
@@ -7005,7 +7107,7 @@ export default {
67,
{
"input": [
- 361,
+ 367,
"UpdateViewSortInput!"
]
}
@@ -7014,7 +7116,7 @@ export default {
6,
{
"input": [
- 363,
+ 369,
"DeleteViewSortInput!"
]
}
@@ -7023,7 +7125,7 @@ export default {
6,
{
"input": [
- 364,
+ 370,
"DestroyViewSortInput!"
]
}
@@ -7032,7 +7134,7 @@ export default {
60,
{
"input": [
- 365,
+ 371,
"UpdateViewFieldInput!"
]
}
@@ -7041,7 +7143,7 @@ export default {
60,
{
"input": [
- 367,
+ 373,
"CreateViewFieldInput!"
]
}
@@ -7050,7 +7152,7 @@ export default {
60,
{
"inputs": [
- 367,
+ 373,
"[CreateViewFieldInput!]!"
]
}
@@ -7059,7 +7161,7 @@ export default {
60,
{
"input": [
- 368,
+ 374,
"DeleteViewFieldInput!"
]
}
@@ -7068,7 +7170,7 @@ export default {
60,
{
"input": [
- 369,
+ 375,
"DestroyViewFieldInput!"
]
}
@@ -7077,7 +7179,7 @@ export default {
69,
{
"input": [
- 370,
+ 376,
"UpdateViewFieldGroupInput!"
]
}
@@ -7086,7 +7188,7 @@ export default {
69,
{
"input": [
- 372,
+ 378,
"CreateViewFieldGroupInput!"
]
}
@@ -7095,7 +7197,7 @@ export default {
69,
{
"inputs": [
- 372,
+ 378,
"[CreateViewFieldGroupInput!]!"
]
}
@@ -7104,7 +7206,7 @@ export default {
69,
{
"input": [
- 373,
+ 379,
"DeleteViewFieldGroupInput!"
]
}
@@ -7113,7 +7215,7 @@ export default {
69,
{
"input": [
- 374,
+ 380,
"DestroyViewFieldGroupInput!"
]
}
@@ -7122,7 +7224,7 @@ export default {
70,
{
"input": [
- 375,
+ 381,
"UpsertFieldsWidgetInput!"
]
}
@@ -7131,7 +7233,7 @@ export default {
2,
{
"input": [
- 378,
+ 384,
"CreateApiKeyInput!"
]
}
@@ -7140,7 +7242,7 @@ export default {
2,
{
"input": [
- 379,
+ 385,
"UpdateApiKeyInput!"
]
}
@@ -7149,7 +7251,7 @@ export default {
2,
{
"input": [
- 380,
+ 386,
"RevokeApiKeyInput!"
]
}
@@ -7168,20 +7270,20 @@ export default {
}
],
"skipSyncEmailOnboardingStep": [
- 156
+ 152
],
"skipBookOnboardingStep": [
- 156
+ 152
],
"checkoutSession": [
- 154,
+ 150,
{
"recurringInterval": [
- 142,
+ 138,
"SubscriptionInterval!"
],
"plan": [
- 138,
+ 134,
"BillingPlanKey!"
],
"requirePaymentMethod": [
@@ -7194,19 +7296,19 @@ export default {
}
],
"switchSubscriptionInterval": [
- 155
+ 151
],
"switchBillingPlan": [
- 155
+ 151
],
"cancelSwitchBillingPlan": [
- 155
+ 151
],
"cancelSwitchBillingInterval": [
- 155
+ 151
],
"setResourceCreditSubscriptionPrice": [
- 155,
+ 151,
{
"priceId": [
1,
@@ -7215,10 +7317,10 @@ export default {
}
],
"endSubscriptionTrialPeriod": [
- 151
+ 147
],
"cancelSwitchResourceCreditPrice": [
- 155
+ 151
],
"deleteWorkspaceInvitation": [
1,
@@ -7230,7 +7332,7 @@ export default {
}
],
"resendWorkspaceInvitation": [
- 158,
+ 154,
{
"appTokenId": [
1,
@@ -7239,7 +7341,7 @@ export default {
}
],
"sendInvitations": [
- 158,
+ 154,
{
"emails": [
1,
@@ -7251,10 +7353,10 @@ export default {
}
],
"createApprovedAccessDomain": [
- 133,
+ 129,
{
"input": [
- 381,
+ 387,
"CreateApprovedAccessDomainInput!"
]
}
@@ -7263,16 +7365,16 @@ export default {
6,
{
"input": [
- 382,
+ 388,
"DeleteApprovedAccessDomainInput!"
]
}
],
"validateApprovedAccessDomain": [
- 133,
+ 129,
{
"input": [
- 383,
+ 389,
"ValidateApprovedAccessDomainInput!"
]
}
@@ -7281,7 +7383,7 @@ export default {
122,
{
"input": [
- 384,
+ 390,
"CreatePageLayoutTabInput!"
]
}
@@ -7294,7 +7396,7 @@ export default {
"String!"
],
"input": [
- 385,
+ 391,
"UpdatePageLayoutTabInput!"
]
}
@@ -7312,7 +7414,7 @@ export default {
123,
{
"input": [
- 386,
+ 392,
"CreatePageLayoutInput!"
]
}
@@ -7325,7 +7427,7 @@ export default {
"String!"
],
"input": [
- 387,
+ 393,
"UpdatePageLayoutInput!"
]
}
@@ -7347,7 +7449,7 @@ export default {
"String!"
],
"input": [
- 388,
+ 394,
"UpdatePageLayoutWithTabsInput!"
]
}
@@ -7379,42 +7481,6 @@ export default {
]
}
],
- "createEmailingDomain": [
- 130,
- {
- "domain": [
- 1,
- "String!"
- ]
- }
- ],
- "deleteEmailingDomain": [
- 6,
- {
- "id": [
- 1,
- "String!"
- ]
- }
- ],
- "verifyEmailingDomain": [
- 130,
- {
- "id": [
- 1,
- "String!"
- ]
- }
- ],
- "sendEmailViaEmailingDomain": [
- 132,
- {
- "input": [
- 392,
- "SendEmailViaDomainInput!"
- ]
- }
- ],
"updateOneApplicationVariable": [
6,
{
@@ -7436,7 +7502,7 @@ export default {
85,
{
"input": [
- 393,
+ 398,
"CreatePageLayoutWidgetInput!"
]
}
@@ -7449,7 +7515,7 @@ export default {
"String!"
],
"input": [
- 394,
+ 399,
"UpdatePageLayoutWidgetInput!"
]
}
@@ -7467,7 +7533,7 @@ export default {
41,
{
"input": [
- 327,
+ 332,
"LogicFunctionIdInput!"
]
}
@@ -7476,16 +7542,16 @@ export default {
41,
{
"input": [
- 395,
+ 400,
"CreateLogicFunctionFromSourceInput!"
]
}
],
"executeOneLogicFunction": [
- 169,
+ 165,
{
"input": [
- 396,
+ 401,
"ExecuteOneLogicFunctionInput!"
]
}
@@ -7494,7 +7560,7 @@ export default {
6,
{
"input": [
- 397,
+ 402,
"UpdateLogicFunctionFromSourceInput!"
]
}
@@ -7503,125 +7569,233 @@ export default {
35,
{
"input": [
- 399,
+ 404,
"CreateCommandMenuItemInput!"
]
}
],
- "updateCommandMenuItem": [
- 35,
+ "updateCommandMenuItem": [
+ 35,
+ {
+ "input": [
+ 405,
+ "UpdateCommandMenuItemInput!"
+ ]
+ }
+ ],
+ "deleteCommandMenuItem": [
+ 35,
+ {
+ "id": [
+ 3,
+ "UUID!"
+ ]
+ }
+ ],
+ "createFrontComponent": [
+ 34,
+ {
+ "input": [
+ 406,
+ "CreateFrontComponentInput!"
+ ]
+ }
+ ],
+ "updateFrontComponent": [
+ 34,
+ {
+ "input": [
+ 407,
+ "UpdateFrontComponentInput!"
+ ]
+ }
+ ],
+ "deleteFrontComponent": [
+ 34,
+ {
+ "id": [
+ 3,
+ "UUID!"
+ ]
+ }
+ ],
+ "createOneObject": [
+ 56,
+ {
+ "input": [
+ 409,
+ "CreateOneObjectInput!"
+ ]
+ }
+ ],
+ "deleteOneObject": [
+ 56,
+ {
+ "input": [
+ 411,
+ "DeleteOneObjectInput!"
+ ]
+ }
+ ],
+ "updateOneObject": [
+ 56,
+ {
+ "input": [
+ 412,
+ "UpdateOneObjectInput!"
+ ]
+ }
+ ],
+ "createOneIndex": [
+ 47,
+ {
+ "input": [
+ 414,
+ "CreateOneIndexInput!"
+ ]
+ }
+ ],
+ "deleteOneIndex": [
+ 47,
+ {
+ "input": [
+ 417,
+ "DeleteOneIndexInput!"
+ ]
+ }
+ ],
+ "createOneAgent": [
+ 25,
+ {
+ "input": [
+ 418,
+ "CreateAgentInput!"
+ ]
+ }
+ ],
+ "updateOneAgent": [
+ 25,
+ {
+ "input": [
+ 419,
+ "UpdateAgentInput!"
+ ]
+ }
+ ],
+ "deleteOneAgent": [
+ 25,
{
"input": [
- 400,
- "UpdateCommandMenuItemInput!"
+ 333,
+ "AgentIdInput!"
]
}
],
- "deleteCommandMenuItem": [
- 35,
+ "sendEmailViaEmailingDomain": [
+ 277,
{
- "id": [
- 3,
- "UUID!"
+ "input": [
+ 420,
+ "SendEmailViaDomainInput!"
]
}
],
- "createFrontComponent": [
- 34,
+ "sendMessageCampaign": [
+ 279,
{
"input": [
- 401,
- "CreateFrontComponentInput!"
+ 421,
+ "SendMessageCampaignInput!"
]
}
],
- "updateFrontComponent": [
- 34,
+ "createUnsubscribeTopic": [
+ 280,
{
"input": [
- 402,
- "UpdateFrontComponentInput!"
+ 422,
+ "CreateUnsubscribeTopicInput!"
]
}
],
- "deleteFrontComponent": [
- 34,
+ "updateUnsubscribeTopic": [
+ 280,
{
- "id": [
- 3,
- "UUID!"
+ "input": [
+ 423,
+ "UpdateUnsubscribeTopicInput!"
]
}
],
- "createOneObject": [
- 56,
+ "deleteUnsubscribeTopic": [
+ 6,
{
- "input": [
- 404,
- "CreateOneObjectInput!"
+ "id": [
+ 1,
+ "String!"
]
}
],
- "deleteOneObject": [
- 56,
+ "updateMessageChannel": [
+ 267,
{
"input": [
- 406,
- "DeleteOneObjectInput!"
+ 424,
+ "UpdateMessageChannelInput!"
]
}
],
- "updateOneObject": [
- 56,
+ "createEmailGroupChannel": [
+ 275,
{
"input": [
- 407,
- "UpdateOneObjectInput!"
+ 426,
+ "CreateEmailGroupChannelInput!"
]
}
],
- "createOneIndex": [
- 47,
+ "deleteEmailGroupChannel": [
+ 267,
{
- "input": [
- 409,
- "CreateOneIndexInput!"
+ "id": [
+ 3,
+ "UUID!"
]
}
],
- "deleteOneIndex": [
- 47,
+ "createEmailingDomain": [
+ 265,
{
"input": [
- 412,
- "DeleteOneIndexInput!"
+ 427,
+ "CreateEmailingDomainInput!"
]
}
],
- "createOneAgent": [
- 25,
+ "deleteEmailingDomain": [
+ 6,
{
- "input": [
- 413,
- "CreateAgentInput!"
+ "id": [
+ 1,
+ "String!"
]
}
],
- "updateOneAgent": [
- 25,
+ "verifyEmailingDomain": [
+ 265,
{
- "input": [
- 414,
- "UpdateAgentInput!"
+ "id": [
+ 1,
+ "String!"
]
}
],
- "deleteOneAgent": [
- 25,
+ "deleteConnectedAccount": [
+ 234,
{
- "input": [
- 328,
- "AgentIdInput!"
+ "id": [
+ 3,
+ "UUID!"
]
}
],
@@ -7642,7 +7816,7 @@ export default {
29,
{
"createRoleInput": [
- 415,
+ 428,
"CreateRoleInput!"
]
}
@@ -7651,7 +7825,7 @@ export default {
29,
{
"updateRoleInput": [
- 416,
+ 429,
"UpdateRoleInput!"
]
}
@@ -7669,7 +7843,7 @@ export default {
16,
{
"upsertObjectPermissionsInput": [
- 418,
+ 431,
"UpsertObjectPermissionsInput!"
]
}
@@ -7678,7 +7852,7 @@ export default {
27,
{
"upsertPermissionFlagsInput": [
- 420,
+ 433,
"UpsertPermissionFlagsInput!"
]
}
@@ -7687,16 +7861,16 @@ export default {
26,
{
"upsertFieldPermissionsInput": [
- 421,
+ 434,
"UpsertFieldPermissionsInput!"
]
}
],
"upsertRowLevelPermissionPredicates": [
- 234,
+ 230,
{
"input": [
- 423,
+ 436,
"UpsertRowLevelPermissionPredicatesInput!"
]
}
@@ -7724,34 +7898,34 @@ export default {
}
],
"runAgent": [
- 278,
+ 292,
{
"input": [
- 426,
+ 439,
"RunAgentInput!"
]
}
],
"createWebhook": [
- 275,
+ 289,
{
"input": [
- 427,
+ 440,
"CreateWebhookInput!"
]
}
],
"updateWebhook": [
- 275,
+ 289,
{
"input": [
- 428,
+ 441,
"UpdateWebhookInput!"
]
}
],
"deleteWebhook": [
- 275,
+ 289,
{
"id": [
3,
@@ -7763,7 +7937,7 @@ export default {
44,
{
"input": [
- 430,
+ 443,
"CreateOneFieldMetadataInput!"
]
}
@@ -7772,7 +7946,7 @@ export default {
44,
{
"input": [
- 432,
+ 445,
"UpdateOneFieldMetadataInput!"
]
}
@@ -7781,7 +7955,7 @@ export default {
44,
{
"input": [
- 434,
+ 447,
"DeleteOneFieldInput!"
]
}
@@ -7790,7 +7964,7 @@ export default {
66,
{
"input": [
- 435,
+ 448,
"CreateViewGroupInput!"
]
}
@@ -7799,7 +7973,7 @@ export default {
66,
{
"inputs": [
- 435,
+ 448,
"[CreateViewGroupInput!]!"
]
}
@@ -7808,7 +7982,7 @@ export default {
66,
{
"input": [
- 436,
+ 449,
"UpdateViewGroupInput!"
]
}
@@ -7817,7 +7991,7 @@ export default {
66,
{
"inputs": [
- 436,
+ 449,
"[UpdateViewGroupInput!]!"
]
}
@@ -7826,7 +8000,7 @@ export default {
66,
{
"input": [
- 438,
+ 451,
"DeleteViewGroupInput!"
]
}
@@ -7835,79 +8009,43 @@ export default {
66,
{
"input": [
- 439,
+ 452,
"DestroyViewGroupInput!"
]
}
],
"updateMessageFolder": [
- 318,
+ 323,
{
"input": [
- 440,
+ 453,
"UpdateMessageFolderInput!"
]
}
],
"updateMessageFolders": [
- 318,
+ 323,
{
"input": [
- 442,
+ 455,
"UpdateMessageFoldersInput!"
]
}
],
- "updateMessageChannel": [
- 309,
- {
- "input": [
- 443,
- "UpdateMessageChannelInput!"
- ]
- }
- ],
- "createEmailGroupChannel": [
- 317,
- {
- "input": [
- 445,
- "CreateEmailGroupChannelInput!"
- ]
- }
- ],
- "deleteEmailGroupChannel": [
- 309,
- {
- "id": [
- 3,
- "UUID!"
- ]
- }
- ],
- "deleteConnectedAccount": [
- 238,
- {
- "id": [
- 3,
- "UUID!"
- ]
- }
- ],
"updateCalendarChannel": [
- 304,
+ 318,
{
"input": [
- 446,
+ 456,
"UpdateCalendarChannelInput!"
]
}
],
"createChatThread": [
- 295
+ 309
],
"sendChatMessage": [
- 299,
+ 313,
{
"threadId": [
3,
@@ -7928,7 +8066,7 @@ export default {
1
],
"fileAttachments": [
- 448,
+ 458,
"[FileAttachmentInput!]"
]
}
@@ -7943,7 +8081,7 @@ export default {
}
],
"renameChatThread": [
- 295,
+ 309,
{
"id": [
3,
@@ -7956,7 +8094,7 @@ export default {
}
],
"archiveChatThread": [
- 295,
+ 309,
{
"id": [
3,
@@ -7965,7 +8103,7 @@ export default {
}
],
"unarchiveChatThread": [
- 295,
+ 309,
{
"id": [
3,
@@ -7992,25 +8130,25 @@ export default {
}
],
"createSkill": [
- 293,
+ 307,
{
"input": [
- 449,
+ 459,
"CreateSkillInput!"
]
}
],
"updateSkill": [
- 293,
+ 307,
{
"input": [
- 450,
+ 460,
"UpdateSkillInput!"
]
}
],
"deleteSkill": [
- 293,
+ 307,
{
"id": [
3,
@@ -8019,7 +8157,7 @@ export default {
}
],
"activateSkill": [
- 293,
+ 307,
{
"id": [
3,
@@ -8028,7 +8166,7 @@ export default {
}
],
"deactivateSkill": [
- 293,
+ 307,
{
"id": [
3,
@@ -8037,7 +8175,7 @@ export default {
}
],
"evaluateAgentTurn": [
- 301,
+ 315,
{
"turnId": [
3,
@@ -8046,7 +8184,7 @@ export default {
}
],
"runEvaluationInput": [
- 302,
+ 316,
{
"agentId": [
3,
@@ -8059,16 +8197,16 @@ export default {
}
],
"getAuthorizationUrlForSSO": [
- 246,
+ 242,
{
"input": [
- 451,
+ 461,
"GetAuthorizationUrlForSSOInput!"
]
}
],
"getLoginTokenFromCredentials": [
- 255,
+ 251,
{
"email": [
1,
@@ -8094,7 +8232,7 @@ export default {
}
],
"signIn": [
- 244,
+ 240,
{
"email": [
1,
@@ -8116,7 +8254,7 @@ export default {
}
],
"verifyEmailAndGetLoginToken": [
- 252,
+ 248,
{
"emailVerificationToken": [
1,
@@ -8136,7 +8274,7 @@ export default {
}
],
"verifyEmailAndGetWorkspaceAgnosticToken": [
- 244,
+ 240,
{
"emailVerificationToken": [
1,
@@ -8152,7 +8290,7 @@ export default {
}
],
"getAuthTokensFromOTP": [
- 254,
+ 250,
{
"otp": [
1,
@@ -8172,7 +8310,7 @@ export default {
}
],
"signUp": [
- 244,
+ 240,
{
"email": [
1,
@@ -8194,7 +8332,7 @@ export default {
}
],
"signUpInWorkspace": [
- 249,
+ 245,
{
"email": [
1,
@@ -8225,13 +8363,13 @@ export default {
}
],
"signUpInNewWorkspace": [
- 249
+ 245
],
"generateTransientToken": [
- 250
+ 246
],
"getAuthTokensFromLoginToken": [
- 254,
+ 250,
{
"loginToken": [
1,
@@ -8244,7 +8382,7 @@ export default {
}
],
"authorizeApp": [
- 242,
+ 238,
{
"clientId": [
1,
@@ -8266,7 +8404,7 @@ export default {
}
],
"renewToken": [
- 254,
+ 250,
{
"appToken": [
1,
@@ -8275,7 +8413,7 @@ export default {
}
],
"generateApiKeyToken": [
- 253,
+ 249,
{
"apiKeyId": [
3,
@@ -8291,7 +8429,7 @@ export default {
32
],
"emailPasswordResetLink": [
- 245,
+ 241,
{
"email": [
1,
@@ -8303,7 +8441,7 @@ export default {
}
],
"updatePasswordViaResetToken": [
- 247,
+ 243,
{
"passwordResetToken": [
1,
@@ -8316,10 +8454,10 @@ export default {
}
],
"createApplicationRegistration": [
- 200,
+ 196,
{
"input": [
- 452,
+ 462,
"CreateApplicationRegistrationInput!"
]
}
@@ -8328,7 +8466,7 @@ export default {
7,
{
"input": [
- 453,
+ 463,
"UpdateApplicationRegistrationInput!"
]
}
@@ -8343,7 +8481,7 @@ export default {
}
],
"rotateApplicationRegistrationClientSecret": [
- 202,
+ 198,
{
"id": [
1,
@@ -8355,7 +8493,7 @@ export default {
5,
{
"input": [
- 455,
+ 465,
"CreateApplicationRegistrationVariableInput!"
]
}
@@ -8364,7 +8502,7 @@ export default {
5,
{
"input": [
- 456,
+ 466,
"UpdateApplicationRegistrationVariableInput!"
]
}
@@ -8382,7 +8520,7 @@ export default {
7,
{
"file": [
- 345,
+ 351,
"Upload!"
],
"universalIdentifier": [
@@ -8404,7 +8542,7 @@ export default {
}
],
"initiateOTPProvisioning": [
- 240,
+ 236,
{
"loginToken": [
1,
@@ -8417,10 +8555,10 @@ export default {
}
],
"initiateOTPProvisioningForAuthenticatedUser": [
- 240
+ 236
],
"deleteTwoFactorAuthenticationMethod": [
- 239,
+ 235,
{
"twoFactorAuthenticationMethodId": [
3,
@@ -8429,7 +8567,7 @@ export default {
}
],
"verifyTwoFactorAuthenticationMethodForAuthenticatedUser": [
- 241,
+ 237,
{
"otp": [
1,
@@ -8453,7 +8591,7 @@ export default {
6,
{
"input": [
- 458,
+ 468,
"UpdateWorkspaceMemberSettingsInput!"
]
}
@@ -8471,7 +8609,7 @@ export default {
}
],
"resendEmailVerificationToken": [
- 220,
+ 216,
{
"email": [
1,
@@ -8487,7 +8625,7 @@ export default {
76,
{
"data": [
- 459,
+ 469,
"ActivateWorkspaceInput!"
]
}
@@ -8496,7 +8634,7 @@ export default {
76,
{
"data": [
- 460,
+ 470,
"UpdateWorkspaceInput!"
]
}
@@ -8505,13 +8643,13 @@ export default {
76
],
"checkCustomDomainValidRecords": [
- 233
+ 229
],
"runWorkspaceMigration": [
6,
{
"workspaceMigration": [
- 461,
+ 471,
"WorkspaceMigrationInput!"
]
}
@@ -8526,43 +8664,43 @@ export default {
}
],
"createOIDCIdentityProvider": [
- 225,
+ 221,
{
"input": [
- 464,
+ 474,
"SetupOIDCSsoInput!"
]
}
],
"createSAMLIdentityProvider": [
- 225,
+ 221,
{
"input": [
- 465,
+ 475,
"SetupSAMLSsoInput!"
]
}
],
"deleteSSOIdentityProvider": [
- 221,
+ 217,
{
"input": [
- 466,
+ 476,
"DeleteSsoInput!"
]
}
],
"editSSOIdentityProvider": [
- 222,
+ 218,
{
"input": [
- 467,
+ 477,
"EditSsoInput!"
]
}
],
"createObjectEvent": [
- 289,
+ 303,
{
"event": [
1,
@@ -8582,10 +8720,10 @@ export default {
}
],
"trackAnalytics": [
- 289,
+ 303,
{
"type": [
- 468,
+ 478,
"AnalyticsType!"
],
"name": [
@@ -8600,7 +8738,7 @@ export default {
}
],
"duplicateDashboard": [
- 287,
+ 301,
{
"id": [
3,
@@ -8609,7 +8747,7 @@ export default {
}
],
"impersonate": [
- 258,
+ 254,
{
"userId": [
3,
@@ -8622,16 +8760,16 @@ export default {
}
],
"sendEmail": [
- 288,
+ 302,
{
"input": [
- 469,
+ 479,
"SendEmailInput!"
]
}
],
"startChannelSync": [
- 279,
+ 293,
{
"connectedAccountId": [
3,
@@ -8640,14 +8778,14 @@ export default {
}
],
"saveImapSmtpCaldavAccount": [
- 274,
+ 288,
{
"handle": [
1,
"String!"
],
"connectionParameters": [
- 471,
+ 481,
"EmailAccountConnectionParameters!"
],
"id": [
@@ -8656,16 +8794,16 @@ export default {
}
],
"updateLabPublicFeatureFlag": [
- 171,
+ 167,
{
"input": [
- 473,
+ 483,
"UpdateLabPublicFeatureFlagInput!"
]
}
],
"createPublicDomain": [
- 267,
+ 263,
{
"domain": [
1,
@@ -8677,7 +8815,7 @@ export default {
}
],
"updatePublicDomain": [
- 267,
+ 263,
{
"domain": [
1,
@@ -8698,7 +8836,7 @@ export default {
}
],
"checkPublicDomainValidRecords": [
- 233,
+ 229,
{
"domain": [
1,
@@ -8710,7 +8848,7 @@ export default {
78,
{
"input": [
- 474,
+ 484,
"CreateOneAppTokenInput!"
]
}
@@ -8743,7 +8881,7 @@ export default {
6
],
"createDevelopmentApplication": [
- 262,
+ 258,
{
"universalIdentifier": [
1,
@@ -8765,7 +8903,7 @@ export default {
}
],
"syncApplication": [
- 263,
+ 259,
{
"manifest": [
15,
@@ -8777,10 +8915,10 @@ export default {
}
],
"uploadApplicationFile": [
- 264,
+ 260,
{
"file": [
- 345,
+ 351,
"Upload!"
],
"applicationUniversalIdentifier": [
@@ -8788,7 +8926,7 @@ export default {
"String!"
],
"fileFolder": [
- 476,
+ 486,
"FileFolder!"
],
"filePath": [
@@ -8865,7 +9003,7 @@ export default {
3
],
"type": [
- 161
+ 157
],
"name": [
1
@@ -8897,7 +9035,7 @@ export default {
3
],
"update": [
- 344
+ 350
],
"__typename": [
1
@@ -9007,7 +9145,7 @@ export default {
3
],
"update": [
- 350
+ 356
],
"__typename": [
1
@@ -9166,16 +9304,16 @@ export default {
3
],
"viewFields": [
- 356
+ 362
],
"viewFilters": [
- 357
+ 363
],
"viewFilterGroups": [
- 358
+ 364
],
"viewSorts": [
- 359
+ 365
],
"__typename": [
1
@@ -9286,7 +9424,7 @@ export default {
3
],
"update": [
- 362
+ 368
],
"__typename": [
1
@@ -9324,7 +9462,7 @@ export default {
3
],
"update": [
- 366
+ 372
],
"__typename": [
1
@@ -9400,7 +9538,7 @@ export default {
3
],
"update": [
- 371
+ 377
],
"__typename": [
1
@@ -9464,10 +9602,10 @@ export default {
3
],
"groups": [
- 376
+ 382
],
"fields": [
- 377
+ 383
],
"__typename": [
1
@@ -9487,7 +9625,7 @@ export default {
6
],
"fields": [
- 377
+ 383
],
"__typename": [
1
@@ -9655,7 +9793,7 @@ export default {
3
],
"tabs": [
- 389
+ 395
],
"__typename": [
1
@@ -9678,7 +9816,7 @@ export default {
89
],
"widgets": [
- 390
+ 396
],
"__typename": [
1
@@ -9701,7 +9839,7 @@ export default {
3
],
"gridPosition": [
- 391
+ 397
],
"position": [
15
@@ -9736,38 +9874,6 @@ export default {
1
]
},
- "SendEmailViaDomainInput": {
- "emailingDomainId": [
- 1
- ],
- "to": [
- 1
- ],
- "cc": [
- 1
- ],
- "bcc": [
- 1
- ],
- "subject": [
- 1
- ],
- "text": [
- 1
- ],
- "html": [
- 1
- ],
- "from": [
- 1
- ],
- "replyTo": [
- 1
- ],
- "__typename": [
- 1
- ]
- },
"CreatePageLayoutWidgetInput": {
"pageLayoutTabId": [
3
@@ -9782,7 +9888,7 @@ export default {
3
],
"gridPosition": [
- 391
+ 397
],
"position": [
15
@@ -9808,7 +9914,7 @@ export default {
3
],
"gridPosition": [
- 391
+ 397
],
"position": [
15
@@ -9880,7 +9986,7 @@ export default {
3
],
"update": [
- 398
+ 403
],
"__typename": [
1
@@ -10040,7 +10146,7 @@ export default {
3
],
"update": [
- 403
+ 408
],
"__typename": [
1
@@ -10059,7 +10165,7 @@ export default {
},
"CreateOneObjectInput": {
"object": [
- 405
+ 410
],
"__typename": [
1
@@ -10119,7 +10225,7 @@ export default {
},
"UpdateOneObjectInput": {
"update": [
- 408
+ 413
],
"id": [
3
@@ -10174,7 +10280,7 @@ export default {
},
"CreateOneIndexInput": {
"index": [
- 410
+ 415
],
"__typename": [
1
@@ -10185,7 +10291,7 @@ export default {
3
],
"fields": [
- 411
+ 416
],
"indexType": [
48
@@ -10286,6 +10392,142 @@ export default {
1
]
},
+ "SendEmailViaDomainInput": {
+ "emailingDomainId": [
+ 1
+ ],
+ "to": [
+ 1
+ ],
+ "cc": [
+ 1
+ ],
+ "bcc": [
+ 1
+ ],
+ "subject": [
+ 1
+ ],
+ "text": [
+ 1
+ ],
+ "html": [
+ 1
+ ],
+ "from": [
+ 1
+ ],
+ "replyTo": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "SendMessageCampaignInput": {
+ "listId": [
+ 1
+ ],
+ "unsubscribeTopicId": [
+ 1
+ ],
+ "subject": [
+ 1
+ ],
+ "body": [
+ 1
+ ],
+ "fromAddress": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "CreateUnsubscribeTopicInput": {
+ "name": [
+ 1
+ ],
+ "description": [
+ 1
+ ],
+ "visibility": [
+ 281
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "UpdateUnsubscribeTopicInput": {
+ "id": [
+ 1
+ ],
+ "name": [
+ 1
+ ],
+ "description": [
+ 1
+ ],
+ "visibility": [
+ 281
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "UpdateMessageChannelInput": {
+ "id": [
+ 3
+ ],
+ "update": [
+ 425
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "UpdateMessageChannelInputUpdates": {
+ "visibility": [
+ 268
+ ],
+ "isContactAutoCreationEnabled": [
+ 6
+ ],
+ "contactAutoCreationPolicy": [
+ 270
+ ],
+ "messageFolderImportPolicy": [
+ 271
+ ],
+ "isSyncEnabled": [
+ 6
+ ],
+ "excludeNonProfessionalEmails": [
+ 6
+ ],
+ "excludeGroupEmails": [
+ 6
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "CreateEmailGroupChannelInput": {
+ "handle": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
+ "CreateEmailingDomainInput": {
+ "domain": [
+ 1
+ ],
+ "__typename": [
+ 1
+ ]
+ },
"CreateRoleInput": {
"id": [
1
@@ -10332,7 +10574,7 @@ export default {
},
"UpdateRoleInput": {
"update": [
- 417
+ 430
],
"id": [
3
@@ -10387,7 +10629,7 @@ export default {
3
],
"objectPermissions": [
- 419
+ 432
],
"__typename": [
1
@@ -10429,7 +10671,7 @@ export default {
3
],
"fieldPermissions": [
- 422
+ 435
],
"__typename": [
1
@@ -10460,10 +10702,10 @@ export default {
3
],
"predicates": [
- 424
+ 437
],
"predicateGroups": [
- 425
+ 438
],
"__typename": [
1
@@ -10557,7 +10799,7 @@ export default {
3
],
"update": [
- 429
+ 442
],
"__typename": [
1
@@ -10582,7 +10824,7 @@ export default {
},
"CreateOneFieldMetadataInput": {
"field": [
- 431
+ 444
],
"__typename": [
1
@@ -10658,7 +10900,7 @@ export default {
3
],
"update": [
- 433
+ 446
],
"__typename": [
1
@@ -10753,7 +10995,7 @@ export default {
3
],
"update": [
- 437
+ 450
],
"__typename": [
1
@@ -10797,7 +11039,7 @@ export default {
3
],
"update": [
- 441
+ 454
],
"__typename": [
1
@@ -10816,52 +11058,7 @@ export default {
3
],
"update": [
- 441
- ],
- "__typename": [
- 1
- ]
- },
- "UpdateMessageChannelInput": {
- "id": [
- 3
- ],
- "update": [
- 444
- ],
- "__typename": [
- 1
- ]
- },
- "UpdateMessageChannelInputUpdates": {
- "visibility": [
- 310
- ],
- "isContactAutoCreationEnabled": [
- 6
- ],
- "contactAutoCreationPolicy": [
- 312
- ],
- "messageFolderImportPolicy": [
- 313
- ],
- "isSyncEnabled": [
- 6
- ],
- "excludeNonProfessionalEmails": [
- 6
- ],
- "excludeGroupEmails": [
- 6
- ],
- "__typename": [
- 1
- ]
- },
- "CreateEmailGroupChannelInput": {
- "handle": [
- 1
+ 454
],
"__typename": [
1
@@ -10872,7 +11069,7 @@ export default {
3
],
"update": [
- 447
+ 457
],
"__typename": [
1
@@ -10880,13 +11077,13 @@ export default {
},
"UpdateCalendarChannelInputUpdates": {
"visibility": [
- 307
+ 321
],
"isContactAutoCreationEnabled": [
6
],
"contactAutoCreationPolicy": [
- 308
+ 322
],
"isSyncEnabled": [
6
@@ -10988,7 +11185,7 @@ export default {
1
],
"update": [
- 454
+ 464
],
"__typename": [
1
@@ -11036,7 +11233,7 @@ export default {
1
],
"update": [
- 457
+ 467
],
"__typename": [
1
@@ -11154,7 +11351,7 @@ export default {
},
"WorkspaceMigrationInput": {
"actions": [
- 462
+ 472
],
"__typename": [
1
@@ -11162,10 +11359,10 @@ export default {
},
"WorkspaceMigrationDeleteActionInput": {
"type": [
- 463
+ 473
],
"metadataName": [
- 321
+ 326
],
"universalIdentifier": [
1
@@ -11228,7 +11425,7 @@ export default {
3
],
"status": [
- 178
+ 174
],
"__typename": [
1
@@ -11258,7 +11455,7 @@ export default {
1
],
"files": [
- 470
+ 480
],
"__typename": [
1
@@ -11277,13 +11474,13 @@ export default {
},
"EmailAccountConnectionParameters": {
"IMAP": [
- 472
+ 482
],
"SMTP": [
- 472
+ 482
],
"CALDAV": [
- 472
+ 482
],
"__typename": [
1
@@ -11322,7 +11519,7 @@ export default {
},
"CreateOneAppTokenInput": {
"appToken": [
- 475
+ 485
],
"__typename": [
1
@@ -11339,7 +11536,7 @@ export default {
"FileFolder": {},
"Subscription": {
"onEventSubscription": [
- 168,
+ 164,
{
"eventStreamId": [
1,
@@ -11348,16 +11545,16 @@ export default {
}
],
"logicFunctionLogs": [
- 235,
+ 231,
{
"input": [
- 478,
+ 488,
"LogicFunctionLogsInput!"
]
}
],
"onAgentChatEvent": [
- 300,
+ 314,
{
"threadId": [
3,
@@ -11366,10 +11563,10 @@ export default {
}
],
"eventLogsLive": [
- 290,
+ 304,
{
"table": [
- 331,
+ 337,
"EventLogTable!"
]
}
diff --git a/packages/twenty-front/codegen-metadata.cjs b/packages/twenty-front/codegen-metadata.cjs
index 66f7a7166c3..3dd50810437 100644
--- a/packages/twenty-front/codegen-metadata.cjs
+++ b/packages/twenty-front/codegen-metadata.cjs
@@ -31,6 +31,7 @@ module.exports = {
'./src/modules/page-layout/widgets/**/graphql/**/*.{ts,tsx}',
'./src/modules/activities/emails/graphql/mutations/**/*.{ts,tsx}',
+ './src/modules/activities/emails/graphql/metadata-queries/**/*.{ts,tsx}',
'./src/modules/dashboards/graphql/**/*.{ts,tsx}',
'./src/modules/page-layout/graphql/**/*.{ts,tsx}',
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index 21859de1f14..34157df09cc 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -803,6 +803,23 @@ export type CalendarConfiguration = {
configurationType: WidgetConfigurationType;
};
+export type CampaignAudiencePreviewDto = {
+ __typename?: 'CampaignAudiencePreviewDTO';
+ duplicateEmails: Scalars['Int']['output'];
+ globallyUnsubscribed: Scalars['Int']['output'];
+ sendable: Scalars['Int']['output'];
+ topicUnsubscribed: Scalars['Int']['output'];
+ totalMembers: Scalars['Int']['output'];
+ withoutEmail: Scalars['Int']['output'];
+};
+
+export type CampaignSkippedRecipientsDto = {
+ __typename?: 'CampaignSkippedRecipientsDTO';
+ deduped: Scalars['Int']['output'];
+ noEmail: Scalars['Int']['output'];
+ overCap: Scalars['Int']['output'];
+};
+
export type Captcha = {
__typename?: 'Captcha';
provider?: Maybe<CaptchaDriverType>;
@@ -869,8 +886,8 @@ export type ClientConfig = {
isClickHouseConfigured: Scalars['Boolean']['output'];
isCloudflareIntegrationEnabled: Scalars['Boolean']['output'];
isConfigVariablesInDbEnabled: Scalars['Boolean']['output'];
- isEmailGroupEnabled: Scalars['Boolean']['output'];
isEmailVerificationRequired: Scalars['Boolean']['output'];
+ isEmailingDomainInDemoMode: Scalars['Boolean']['output'];
isGoogleCalendarEnabled: Scalars['Boolean']['output'];
isGoogleMessagingEnabled: Scalars['Boolean']['output'];
isImapSmtpCaldavEnabled: Scalars['Boolean']['output'];
@@ -1047,6 +1064,10 @@ export type CreateEmailGroupChannelOutput = {
messageChannel: MessageChannel;
};
+export type CreateEmailingDomainInput = {
+ domain: Scalars['String']['input'];
+};
+
export type CreateFieldInput = {
defaultValue?: InputMaybe<Scalars['JSON']['input']>;
description?: InputMaybe<Scalars['String']['input']>;
@@ -1205,6 +1226,12 @@ export type CreateSkillInput = {
name: Scalars['String']['input'];
};
+export type CreateUnsubscribeTopicInput = {
+ description?: InputMaybe<Scalars['String']['input']>;
+ name: Scalars['String']['input'];
+ visibility?: InputMaybe<UnsubscribeTopicVisibility>;
+};
+
export type CreateViewFieldGroupInput = {
id?: InputMaybe<Scalars['UUID']['input']>;
isVisible?: InputMaybe<Scalars['Boolean']['input']>;
@@ -1494,6 +1521,7 @@ export enum EngineComponentKey {
ADD_TO_FAVORITES = 'ADD_TO_FAVORITES',
ASK_AI = 'ASK_AI',
CANCEL_DASHBOARD_LAYOUT = 'CANCEL_DASHBOARD_LAYOUT',
+ COMPOSE_CAMPAIGN = 'COMPOSE_CAMPAIGN',
COMPOSE_EMAIL = 'COMPOSE_EMAIL',
CREATE_NEW_RECORD = 'CREATE_NEW_RECORD',
CREATE_NEW_VIEW = 'CREATE_NEW_VIEW',
@@ -2432,6 +2460,7 @@ export type Mutation = {
createPublicDomain: PublicDomain;
createSAMLIdentityProvider: SetupSso;
createSkill: Skill;
+ createUnsubscribeTopic: UnsubscribeTopic;
createView: View;
createViewField: ViewField;
createViewFieldGroup: ViewFieldGroup;
@@ -2464,6 +2493,7 @@ export type Mutation = {
deleteSSOIdentityProvider: DeleteSso;
deleteSkill: Skill;
deleteTwoFactorAuthenticationMethod: DeleteTwoFactorAuthenticationMethod;
+ deleteUnsubscribeTopic: Scalars['Boolean']['output'];
deleteUser: User;
deleteUserFromWorkspace: UserWorkspace;
deleteView: Scalars['Boolean']['output'];
@@ -2526,6 +2556,7 @@ export type Mutation = {
sendEmail: SendEmailOutput;
sendEmailViaEmailingDomain: SendEmailViaDomainOutput;
sendInvitations: SendInvitations;
+ sendMessageCampaign: SendMessageCampaignOutputDto;
setEnterpriseKey: EnterpriseLicenseInfoDto;
setResourceCreditSubscriptionPrice: BillingUpdate;
signIn: AvailableWorkspacesAndAccessTokens;
@@ -2570,6 +2601,7 @@ export type Mutation = {
updatePasswordViaResetToken: InvalidatePassword;
updatePublicDomain: PublicDomain;
updateSkill: Skill;
+ updateUnsubscribeTopic: UnsubscribeTopic;
updateUserEmail: Scalars['Boolean']['output'];
updateView: View;
updateViewField: ViewField;
@@ -2697,7 +2729,7 @@ export type MutationCreateEmailGroupChannelArgs = {
export type MutationCreateEmailingDomainArgs = {
- domain: Scalars['String']['input'];
+ input: CreateEmailingDomainInput;
};
@@ -2810,6 +2842,11 @@ export type MutationCreateSkillArgs = {
};
+export type MutationCreateUnsubscribeTopicArgs = {
+ input: CreateUnsubscribeTopicInput;
+};
+
+
export type MutationCreateViewArgs = {
input: CreateViewInput;
};
@@ -2965,6 +3002,11 @@ export type MutationDeleteTwoFactorAuthenticationMethodArgs = {
};
+export type MutationDeleteUnsubscribeTopicArgs = {
+ id: Scalars['String']['input'];
+};
+
+
export type MutationDeleteUserFromWorkspaceArgs = {
workspaceMemberIdToDelete: Scalars['String']['input'];
};
@@ -3266,6 +3308,11 @@ export type MutationSendInvitationsArgs = {
};
+export type MutationSendMessageCampaignArgs = {
+ input: SendMessageCampaignInput;
+};
+
+
export type MutationSetEnterpriseKeyArgs = {
enterpriseKey: Scalars['String']['input'];
};
@@ -3484,6 +3531,11 @@ export type MutationUpdateSkillArgs = {
};
+export type MutationUpdateUnsubscribeTopicArgs = {
+ input: UpdateUnsubscribeTopicInput;
+};
+
+
export type MutationUpdateUserEmailArgs = {
newEmail: Scalars['String']['input'];
verifyEmailRedirectPath?: InputMaybe<Scalars['String']['input']>;
@@ -4080,6 +4132,11 @@ export type PlaceDetailsResult = {
street?: Maybe<Scalars['String']['output']>;
};
+export type PreviewMessageCampaignAudienceInput = {
+ listId: Scalars['String']['input'];
+ unsubscribeTopicId?: InputMaybe<Scalars['String']['input']>;
+};
+
export type PublicApplicationRegistration = {
__typename?: 'PublicApplicationRegistration';
id: Scalars['UUID']['output'];
@@ -4241,8 +4298,11 @@ export type Query = {
objectRecordCounts: Array<ObjectRecordCount>;
objects: ObjectConnection;
pieChartData: PieChartData;
+ previewMessageCampaignAudience: CampaignAudiencePreviewDto;
skill?: Maybe<Skill>;
skills: Array<Skill>;
+ unsubscribePagePreviewUrl: Scalars['String']['output'];
+ unsubscribeTopics: Array<UnsubscribeTopic>;
validatePasswordResetToken: ValidatePasswordResetToken;
webhook?: Maybe<Webhook>;
webhooks: Array<Webhook>;
@@ -4605,6 +4665,11 @@ export type QueryPieChartDataArgs = {
};
+export type QueryPreviewMessageCampaignAudienceArgs = {
+ input: PreviewMessageCampaignAudienceInput;
+};
+
+
export type QuerySkillArgs = {
id: Scalars['UUID']['input'];
};
@@ -4871,6 +4936,21 @@ export type SendInvitations = {
success: Scalars['Boolean']['output'];
};
+export type SendMessageCampaignInput = {
+ body: Scalars['String']['input'];
+ fromAddress: Scalars['String']['input'];
+ listId: Scalars['String']['input'];
+ subject: Scalars['String']['input'];
+ unsubscribeTopicId?: InputMaybe<Scalars['String']['input']>;
+};
+
+export type SendMessageCampaignOutputDto = {
+ __typename?: 'SendMessageCampaignOutputDTO';
+ campaignId: Scalars['String']['output'];
+ queuedCount: Scalars['Int']['output'];
+ skipped: CampaignSkippedRecipientsDto;
+};
+
export type Sentry = {
__typename?: 'Sentry';
dsn?: Maybe<Scalars['String']['output']>;
@@ -5042,6 +5122,21 @@ export type UuidFilterComparison = {
notLike?: InputMaybe<Scalars['UUID']['input']>;
};
+export type UnsubscribeTopic = {
+ __typename?: 'UnsubscribeTopic';
+ createdAt: Scalars['DateTime']['output'];
+ description?: Maybe<Scalars['String']['output']>;
+ id: Scalars['UUID']['output'];
+ name?: Maybe<Scalars['String']['output']>;
+ updatedAt: Scalars['DateTime']['output'];
+ visibility: UnsubscribeTopicVisibility;
+};
+
+export enum UnsubscribeTopicVisibility {
+ PRIVATE = 'PRIVATE',
+ PUBLIC = 'PUBLIC'
+}
+
export type UpdateAgentInput = {
description?: InputMaybe<Scalars['String']['input']>;
evaluationInputs?: InputMaybe<Array<Scalars['String']['input']>>;
@@ -5330,6 +5425,13 @@ export type UpdateSkillInput = {
name?: InputMaybe<Scalars['String']['input']>;
};
+export type UpdateUnsubscribeTopicInput = {
+ description?: InputMaybe<Scalars['String']['input']>;
+ id: Scalars['String']['input'];
+ name?: InputMaybe<Scalars['String']['input']>;
+ visibility?: InputMaybe<UnsubscribeTopicVisibility>;
+};
+
export type UpdateViewFieldGroupInput = {
/** The id of the view field group to update */
id: Scalars['UUID']['input'];
@@ -6130,6 +6232,18 @@ export type WorkspaceUrlsAndId = {
workspaceUrls: WorkspaceUrls;
};
+export type PreviewMessageCampaignAudienceQueryVariables = Exact<{
+ input: PreviewMessageCampaignAudienceInput;
+}>;
+
+
+export type PreviewMessageCampaignAudienceQuery = { __typename?: 'Query', previewMessageCampaignAudience: { __typename?: 'CampaignAudiencePreviewDTO', totalMembers: number, withoutEmail: number, duplicateEmails: number, globallyUnsubscribed: number, topicUnsubscribed: number, sendable: number } };
+
+export type UnsubscribeTopicsQueryVariables = Exact<{ [key: string]: never; }>;
+
+
+export type UnsubscribeTopicsQuery = { __typename?: 'Query', unsubscribeTopics: Array<{ __typename?: 'UnsubscribeTopic', id: string, name?: string | null, description?: string | null, visibility: UnsubscribeTopicVisibility }> };
+
export type SendEmailMutationVariables = Exact<{
input: SendEmailInput;
}>;
@@ -6137,6 +6251,13 @@ export type SendEmailMutationVariables = Exact<{
export type SendEmailMutation = { __typename?: 'Mutation', sendEmail: { __typename?: 'SendEmailOutput', success: boolean, error?: string | null } };
+export type SendMessageCampaignMutationVariables = Exact<{
+ input: SendMessageCampaignInput;
+}>;
+
+
+export type SendMessageCampaignMutation = { __typename?: 'Mutation', sendMessageCampaign: { __typename?: 'SendMessageCampaignOutputDTO', campaignId: string, queuedCount: number, skipped: { __typename?: 'CampaignSkippedRecipientsDTO', noEmail: number, deduped: number, overCap: number } } };
+
export type AgentFieldsFragment = { __typename?: 'Agent', id: string, name: string, label: string, description?: string | null, icon?: string | null, prompt: string, modelId: string, responseFormat?: any | null, roleId?: string | null, isCustom: boolean, modelConfiguration?: any | null, evaluationInputs: Array<string>, applicationId?: string | null, createdAt: string, updatedAt: string };
export type SkillFieldsFragment = { __typename?: 'Skill', id: string, name: string, label: string, description?: string | null, icon?: string | null, content: string, isCustom: boolean, isActive: boolean, createdAt: string, updatedAt: string };
@@ -7652,13 +7773,6 @@ export type FindManyPublicDomainsQueryVariables = Exact<{ [key: string]: never;
export type FindManyPublicDomainsQuery = { __typename?: 'Query', findManyPublicDomains: Array<{ __typename?: 'PublicDomain', id: string, domain: string, isValidated: boolean, applicationId?: string | null, createdAt: string }> };
-export type CreateEmailingDomainMutationVariables = Exact<{
- domain: Scalars['String']['input'];
-}>;
-
-
-export type CreateEmailingDomainMutation = { __typename?: 'Mutation', createEmailingDomain: { __typename?: 'EmailingDomain', id: string, domain: string, status: EmailingDomainStatus, verifiedAt?: string | null, createdAt: string, updatedAt: string, verificationRecords?: Array<{ __typename?: 'VerificationRecord', type: string, key: string, value: string, priority?: number | null }> | null } };
-
export type DeleteEmailingDomainMutationVariables = Exact<{
id: Scalars['String']['input'];
}>;
@@ -7894,6 +8008,32 @@ export type VerifyTwoFactorAuthenticationMethodForAuthenticatedUserMutationVaria
export type VerifyTwoFactorAuthenticationMethodForAuthenticatedUserMutation = { __typename?: 'Mutation', verifyTwoFactorAuthenticationMethodForAuthenticatedUser: { __typename?: 'VerifyTwoFactorAuthenticationMethod', success: boolean } };
+export type CreateUnsubscribeTopicMutationVariables = Exact<{
+ input: CreateUnsubscribeTopicInput;
+}>;
+
+
+export type CreateUnsubscribeTopicMutation = { __typename?: 'Mutation', createUnsubscribeTopic: { __typename?: 'UnsubscribeTopic', id: string, name?: string | null, description?: string | null, visibility: UnsubscribeTopicVisibility } };
+
+export type DeleteUnsubscribeTopicMutationVariables = Exact<{
+ id: Scalars['String']['input'];
+}>;
+
+
+export type DeleteUnsubscribeTopicMutation = { __typename?: 'Mutation', deleteUnsubscribeTopic: boolean };
+
+export type UpdateUnsubscribeTopicMutationVariables = Exact<{
+ input: UpdateUnsubscribeTopicInput;
+}>;
+
+
+export type UpdateUnsubscribeTopicMutation = { __typename?: 'Mutation', updateUnsubscribeTopic: { __typename?: 'UnsubscribeTopic', id: string, name?: string | null, description?: string | null, visibility: UnsubscribeTopicVisibility } };
+
+export type UnsubscribePagePreviewUrlQueryVariables = Exact<{ [key: string]: never; }>;
+
+
+export type UnsubscribePagePreviewUrlQuery = { __typename?: 'Query', unsubscribePagePreviewUrl: string };
+
export type GetUsageAnalyticsQueryVariables = Exact<{
input?: InputMaybe<UsageAnalyticsInput>;
}>;
@@ -8403,7 +8543,10 @@ export const ViewFilterGroupFragmentFragmentDoc = {"kind":"Document","definition
export const ViewSortFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewSortFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewSort"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"direction"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<ViewSortFragmentFragment, unknown>;
export const ViewGroupFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"fieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}}]} as unknown as DocumentNode<ViewGroupFragmentFragment, unknown>;
export const ViewFragmentFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"View"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"objectMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isCompact"}},{"kind":"Field","name":{"kind":"Name","value":"openRecordIn"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanAggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"kanbanAggregateOperationFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"mainGroupByFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"shouldHideEmptyGroups"}},{"kind":"Field","name":{"kind":"Name","value":"anyFieldFilterValue"}},{"kind":"Field","name":{"kind":"Name","value":"calendarFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"calendarLayout"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}},{"kind":"Field","name":{"kind":"Name","value":"createdByUserWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"viewFields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldGroupFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFilters"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFilterFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewFilterGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFilterGroupFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewSorts"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewSortFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"viewGroups"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewGroupFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewField"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"size"}},{"kind":"Field","name":{"kind":"Name","value":"aggregateOperation"}},{"kind":"Field","name":{"kind":"Name","value":"viewFieldGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFieldGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFieldGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"viewFields"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ViewFieldFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFilterFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFilter"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"operand"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"viewFilterGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"positionInViewFilterGroup"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"relationTargetFieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewFilterGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewFilterGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"parentViewFilterGroupId"}},{"kind":"Field","name":{"kind":"Name","value":"logicalOperator"}},{"kind":"Field","name":{"kind":"Name","value":"positionInViewFilterGroup"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewSortFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewSort"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"fieldMetadataId"}},{"kind":"Field","name":{"kind":"Name","value":"direction"}},{"kind":"Field","name":{"kind":"Name","value":"subFieldName"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ViewGroupFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ViewGroup"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"isVisible"}},{"kind":"Field","name":{"kind":"Name","value":"fieldValue"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"viewId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}}]}}]} as unknown as DocumentNode<ViewFragmentFragment, unknown>;
+export const PreviewMessageCampaignAudienceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"PreviewMessageCampaignAudience"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"PreviewMessageCampaignAudienceInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"previewMessageCampaignAudience"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"totalMembers"}},{"kind":"Field","name":{"kind":"Name","value":"withoutEmail"}},{"kind":"Field","name":{"kind":"Name","value":"duplicateEmails"}},{"kind":"Field","name":{"kind":"Name","value":"globallyUnsubscribed"}},{"kind":"Field","name":{"kind":"Name","value":"topicUnsubscribed"}},{"kind":"Field","name":{"kind":"Name","value":"sendable"}}]}}]}}]} as unknown as DocumentNode<PreviewMessageCampaignAudienceQuery, PreviewMessageCampaignAudienceQueryVariables>;
+export const UnsubscribeTopicsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UnsubscribeTopics"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"unsubscribeTopics"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}}]}}]}}]} as unknown as DocumentNode<UnsubscribeTopicsQuery, UnsubscribeTopicsQueryVariables>;
export const SendEmailDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SendEmail"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SendEmailInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sendEmail"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}},{"kind":"Field","name":{"kind":"Name","value":"error"}}]}}]}}]} as unknown as DocumentNode<SendEmailMutation, SendEmailMutationVariables>;
+export const SendMessageCampaignDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SendMessageCampaign"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"SendMessageCampaignInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"sendMessageCampaign"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"campaignId"}},{"kind":"Field","name":{"kind":"Name","value":"queuedCount"}},{"kind":"Field","name":{"kind":"Name","value":"skipped"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"noEmail"}},{"kind":"Field","name":{"kind":"Name","value":"deduped"}},{"kind":"Field","name":{"kind":"Name","value":"overCap"}}]}}]}}]}}]} as unknown as DocumentNode<SendMessageCampaignMutation, SendMessageCampaignMutationVariables>;
export const ActivateSkillDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ActivateSkill"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activateSkill"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"SkillFields"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"SkillFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Skill"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"icon"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"isCustom"}},{"kind":"Field","name":{"kind":"Name","value":"isActive"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]} as unknown as DocumentNode<ActivateSkillMutation, ActivateSkillMutationVariables>;
export const ArchiveChatThreadDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ArchiveChatThread"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"archiveChatThread"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"deletedAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<ArchiveChatThreadMutation, ArchiveChatThreadMutationVariables>;
export const AssignRoleToAgentDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AssignRoleToAgent"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"agentId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"roleId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"assignRoleToAgent"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"agentId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"agentId"}}},{"kind":"Argument","name":{"kind":"Name","value":"roleId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"roleId"}}}]}]}}]} as unknown as DocumentNode<AssignRoleToAgentMutation, AssignRoleToAgentMutationVariables>;
@@ -8572,7 +8715,6 @@ export const CreatePublicDomainDocument = {"kind":"Document","definitions":[{"ki
export const DeletePublicDomainDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeletePublicDomain"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"domain"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deletePublicDomain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"domain"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domain"}}}]}]}}]} as unknown as DocumentNode<DeletePublicDomainMutation, DeletePublicDomainMutationVariables>;
export const UpdatePublicDomainDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdatePublicDomain"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"domain"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updatePublicDomain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"domain"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domain"}}},{"kind":"Argument","name":{"kind":"Name","value":"applicationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"domain"}},{"kind":"Field","name":{"kind":"Name","value":"isValidated"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]} as unknown as DocumentNode<UpdatePublicDomainMutation, UpdatePublicDomainMutationVariables>;
export const FindManyPublicDomainsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManyPublicDomains"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findManyPublicDomains"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"domain"}},{"kind":"Field","name":{"kind":"Name","value":"isValidated"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}}]}}]}}]} as unknown as DocumentNode<FindManyPublicDomainsQuery, FindManyPublicDomainsQueryVariables>;
-export const CreateEmailingDomainDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateEmailingDomain"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"domain"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createEmailingDomain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"domain"},"value":{"kind":"Variable","name":{"kind":"Name","value":"domain"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"domain"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"verifiedAt"}},{"kind":"Field","name":{"kind":"Name","value":"verificationRecords"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<CreateEmailingDomainMutation, CreateEmailingDomainMutationVariables>;
export const DeleteEmailingDomainDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteEmailingDomain"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteEmailingDomain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}]}}]} as unknown as DocumentNode<DeleteEmailingDomainMutation, DeleteEmailingDomainMutationVariables>;
export const VerifyEmailingDomainDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"VerifyEmailingDomain"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"verifyEmailingDomain"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"domain"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"verifiedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<VerifyEmailingDomainMutation, VerifyEmailingDomainMutationVariables>;
export const GetEmailingDomainsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetEmailingDomains"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getEmailingDomains"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"domain"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"verifiedAt"}},{"kind":"Field","name":{"kind":"Name","value":"verificationRecords"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"priority"}}]}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<GetEmailingDomainsQuery, GetEmailingDomainsQueryVariables>;
@@ -8606,6 +8748,10 @@ export const ValidateApprovedAccessDomainDocument = {"kind":"Document","definiti
export const GetApprovedAccessDomainsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetApprovedAccessDomains"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getApprovedAccessDomains"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"domain"}},{"kind":"Field","name":{"kind":"Name","value":"isValidated"}}]}}]}}]} as unknown as DocumentNode<GetApprovedAccessDomainsQuery, GetApprovedAccessDomainsQueryVariables>;
export const GetSsoIdentityProvidersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSSOIdentityProviders"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getSSOIdentityProviders"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"issuer"}},{"kind":"Field","name":{"kind":"Name","value":"status"}}]}}]}}]} as unknown as DocumentNode<GetSsoIdentityProvidersQuery, GetSsoIdentityProvidersQueryVariables>;
export const VerifyTwoFactorAuthenticationMethodForAuthenticatedUserDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"verifyTwoFactorAuthenticationMethodForAuthenticatedUser"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"otp"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"verifyTwoFactorAuthenticationMethodForAuthenticatedUser"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"otp"},"value":{"kind":"Variable","name":{"kind":"Name","value":"otp"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}}]}}]}}]} as unknown as DocumentNode<VerifyTwoFactorAuthenticationMethodForAuthenticatedUserMutation, VerifyTwoFactorAuthenticationMethodForAuthenticatedUserMutationVariables>;
+export const CreateUnsubscribeTopicDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateUnsubscribeTopic"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateUnsubscribeTopicInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createUnsubscribeTopic"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}}]}}]}}]} as unknown as DocumentNode<CreateUnsubscribeTopicMutation, CreateUnsubscribeTopicMutationVariables>;
+export const DeleteUnsubscribeTopicDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteUnsubscribeTopic"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteUnsubscribeTopic"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}]}]}}]} as unknown as DocumentNode<DeleteUnsubscribeTopicMutation, DeleteUnsubscribeTopicMutationVariables>;
+export const UpdateUnsubscribeTopicDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateUnsubscribeTopic"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateUnsubscribeTopicInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateUnsubscribeTopic"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"visibility"}}]}}]}}]} as unknown as DocumentNode<UpdateUnsubscribeTopicMutation, UpdateUnsubscribeTopicMutationVariables>;
+export const UnsubscribePagePreviewUrlDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"UnsubscribePagePreviewUrl"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"unsubscribePagePreviewUrl"}}]}}]} as unknown as DocumentNode<UnsubscribePagePreviewUrlQuery, UnsubscribePagePreviewUrlQueryVariables>;
export const GetUsageAnalyticsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetUsageAnalytics"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"UsageAnalyticsInput"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"getUsageAnalytics"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"usageByUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"usageByOperationType"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"usageByModel"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"timeSeries"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}},{"kind":"Field","name":{"kind":"Name","value":"periodStart"}},{"kind":"Field","name":{"kind":"Name","value":"periodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"userDailyUsage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"userWorkspaceId"}},{"kind":"Field","name":{"kind":"Name","value":"dailyUsage"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"date"}},{"kind":"Field","name":{"kind":"Name","value":"creditsUsed"}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetUsageAnalyticsQuery, GetUsageAnalyticsQueryVariables>;
export const DeleteUserAccountDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteUserAccount"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<DeleteUserAccountMutation, DeleteUserAccountMutationVariables>;
export const DeleteUserWorkspaceDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteUserWorkspace"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"workspaceMemberIdToDelete"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteUserFromWorkspace"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"workspaceMemberIdToDelete"},"value":{"kind":"Variable","name":{"kind":"Name","value":"workspaceMemberIdToDelete"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<DeleteUserWorkspaceMutation, DeleteUserWorkspaceMutationVariables>;
diff --git a/packages/twenty-front/src/locales/en.po b/packages/twenty-front/src/locales/en.po
index 67ecf6b4063..49c522f319f 100644
--- a/packages/twenty-front/src/locales/en.po
+++ b/packages/twenty-front/src/locales/en.po
@@ -96,12 +96,12 @@ msgid "(selected: {selectedIconKey})"
msgstr "(selected: {selectedIconKey})"
#. js-lingui-id: ZBGbuw
-#: src/pages/settings/security/event-logs/components/EventLogJsonCell.tsx
#: src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx
#: src/modules/workflow/workflow-steps/components/WorkflowRunStepInputDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsToolCallRow.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsDetail.tsx
+#: src/modules/settings/event-logs/components/EventLogJsonCell.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJsonDataIndicatorHealthStatus.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
@@ -168,12 +168,25 @@ msgstr "{0, plural, one {You do not have permission to access the {fieldsList} f
msgid "{0} - Config"
msgstr "{0} - Config"
+#. js-lingui-id: okrK9q
+#. placeholder {0}: preview.duplicateEmails
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
+msgid "{0} duplicate"
+msgstr "{0} duplicate"
+
#. js-lingui-id: stCODw
#. placeholder {0}: appObject.fields.length
#: src/modules/settings/applications/hooks/useComputeObjectAndFieldsContentForApplication.ts
msgid "{0} fields"
msgstr "{0} fields"
+#. js-lingui-id: MY0lRK
+#. placeholder {0}: preview.totalMembers
+#. placeholder {1}: preview.sendable
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
+msgid "{0} in this list — {1} sendable"
+msgstr "{0} in this list — {1} sendable"
+
#. js-lingui-id: T8aKxO
#. placeholder {0}: layout.name
#: src/modules/settings/applications/hooks/useComputeApplicationContentForLayoutAndLogic.ts
@@ -186,6 +199,19 @@ msgstr "{0} layout"
msgid "{0} layout edition"
msgstr "{0} layout edition"
+#. js-lingui-id: FGOUAP
+#. placeholder {0}: displayedRecords.length
+#. placeholder {1}: totalCount + liveRecords.length
+#: src/modules/settings/event-logs/components/SettingsLogs.tsx
+msgid "{0} of {1}"
+msgstr "{0} of {1}"
+
+#. js-lingui-id: gBwwKQ
+#. placeholder {0}: preview.topicUnsubscribed
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
+msgid "{0} opted out of this group"
+msgstr "{0} opted out of this group"
+
#. js-lingui-id: peiknr
#. placeholder {0}: activeVisibleFieldLabels.length
#. placeholder {0}: activeFilterLabels.length
@@ -196,6 +222,12 @@ msgstr "{0} layout edition"
msgid "{0} shown"
msgstr "{0} shown"
+#. js-lingui-id: nZUq+6
+#. placeholder {0}: preview.globallyUnsubscribed
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
+msgid "{0} unsubscribed from everything"
+msgstr "{0} unsubscribed from everything"
+
#. js-lingui-id: r4l/MK
#. placeholder {0}: formatUsageValue(totalCredits)
#: src/pages/settings/billing/SettingsUsageUserDetail.tsx
@@ -214,6 +246,12 @@ msgstr "{0} view"
msgid "{0} widgets"
msgstr "{0} widgets"
+#. js-lingui-id: Aixgij
+#. placeholder {0}: preview.withoutEmail
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
+msgid "{0} without email"
+msgstr "{0} without email"
+
#. js-lingui-id: 2UKfhY
#. placeholder {0}: selectedItemNames.length
#: src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInput.tsx
@@ -296,11 +334,6 @@ msgstr "{count, plural, one {E.g. {0}{1} for {count} decimal} other {E.g. {2}{3}
msgid "{credits} Credits - ${priceDisplay}"
msgstr "{credits} Credits - ${priceDisplay}"
-#. js-lingui-id: jsKQu8
-#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
-msgid "{currentRank} of {totalCount} in {objectLabelPlural}"
-msgstr "{currentRank} of {totalCount} in {objectLabelPlural}"
-
#. js-lingui-id: 0aO0VO
#: src/pages/settings/admin-panel/SettingsAdminQueueDetail.tsx
msgid "{days, plural, one {{days} day} other {{days} days}}"
@@ -441,11 +474,6 @@ msgstr "{num, selectordinal, one {{num}st} two {{num}nd} few {{num}rd} other {{n
msgid "{numberOfSelectedItems} workspace members"
msgstr "{numberOfSelectedItems} workspace members"
-#. js-lingui-id: 7kYa/u
-#: src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts
-msgid "{objectLabelPlural} ({totalCount})"
-msgstr "{objectLabelPlural} ({totalCount})"
-
#. js-lingui-id: FaQB54
#: src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/hooks/useWorkflowAiAgentPermissionActions.ts
msgid "{permissionLabel} permission removed"
@@ -461,11 +489,6 @@ msgstr "{permissionLabel} Permission removed"
msgid "{positionLabel} record holds priority"
msgstr "{positionLabel} record holds priority"
-#. js-lingui-id: Sxx5Hr
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
-msgid "{recordCount} of {totalCount} records"
-msgstr "{recordCount} of {totalCount} records"
-
#. js-lingui-id: 5d0hY6
#: src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts
#: src/modules/settings/admin-panel/health-status/hooks/useRetryJobs.ts
@@ -626,12 +649,6 @@ msgstr "1. Select a field type"
msgid "1. Select an object"
msgstr "1. Select an object"
-#. js-lingui-id: SLjiTq
-#: src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx
-#: src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx
-msgid "1. Type"
-msgstr "1. Type"
-
#. js-lingui-id: rU05hS
#: src/modules/settings/experience/components/DateTimeSettingsTimeFormatSelect.tsx
msgid "12h"
@@ -647,12 +664,6 @@ msgstr "12h ({hour12Label})"
msgid "1d"
msgstr "1d"
-#. js-lingui-id: yXvRMf
-#: src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx
-#: src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx
-msgid "2. Configure"
-msgstr "2. Configure"
-
#. js-lingui-id: 0HAF12
#: src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsx
msgid "2. Configure field"
@@ -836,11 +847,6 @@ msgstr "Access Key ID"
msgid "Access your workspace data"
msgstr "Access your workspace data"
-#. js-lingui-id: c2UA7k
-#: src/pages/settings/ai/components/SettingsAiMCP.tsx
-msgid "Access your workspace data from your favorite MCP client like Claude Desktop, Windsurf or Cursor."
-msgstr "Access your workspace data from your favorite MCP client like Claude Desktop, Windsurf or Cursor."
-
#. js-lingui-id: AeXO77
#: src/pages/settings/accounts/SettingsAccountsConfigurationStepEmail.tsx
#: src/pages/settings/accounts/SettingsAccountsConfigurationStepCalendar.tsx
@@ -1059,15 +1065,10 @@ msgstr "Add custom endpoints, private gateways, or additional regions."
msgid "Add Custom Provider"
msgstr "Add Custom Provider"
-#. js-lingui-id: +Gf1IN
+#. js-lingui-id: WT0Ie4
#: src/modules/settings/workspace/components/SettingsWorkspaceEmailGroupSection.tsx
-msgid "Add email handle"
-msgstr "Add email handle"
-
-#. js-lingui-id: HMM0Sc
-#: src/modules/settings/workspace/components/SettingsWorkspaceEmailingDomainsSection.tsx
-msgid "Add emailing domain"
-msgstr "Add emailing domain"
+msgid "Add email channel"
+msgstr "Add email channel"
#. js-lingui-id: DpV70M
#: src/modules/workflow/workflow-steps/workflow-actions/form-action/components/WorkflowEditActionFormBuilder.tsx
@@ -1369,6 +1370,12 @@ msgstr "Address 2"
msgid "Admin"
msgstr "Admin"
+#. js-lingui-id: SsHJsm
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Admin panel"
+msgstr "Admin panel"
+
#. js-lingui-id: g1in8j
#: src/pages/settings/admin-panel/SettingsAdminNewAiProvider.tsx
#: src/pages/settings/admin-panel/SettingsAdminNewAiModel.tsx
@@ -1410,11 +1417,22 @@ msgstr "Admin Panel - General"
msgid "Admin Panel - Health"
msgstr "Admin Panel - Health"
+#. js-lingui-id: Faptqt
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
+msgid "Administrator"
+msgstr "Administrator"
+
+#. js-lingui-id: 3zE1mx
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
+msgid "Administrators"
+msgstr "Administrators"
+
#. js-lingui-id: sxkWRg
#: src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx
#: src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx
#: src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowObjectDropdownContent.tsx
#: src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowObjectDropdownContent.tsx
+#: src/modules/navigation/components/SettingsNavigationDrawer.tsx
msgid "Advanced"
msgstr "Advanced"
@@ -1439,11 +1457,6 @@ msgstr "Advanced objects"
msgid "Advanced options"
msgstr "Advanced options"
-#. js-lingui-id: WsKDNF
-#: src/modules/navigation/components/SettingsNavigationDrawer.tsx
-msgid "Advanced:"
-msgstr "Advanced:"
-
#. js-lingui-id: 1Cox/a
#: src/pages/settings/profile/appearance/components/LocalePicker.tsx
msgid "Afrikaans"
@@ -1730,7 +1743,7 @@ msgid "All lines"
msgstr "All lines"
#. js-lingui-id: c3lkKf
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
msgid "All Members"
msgstr "All Members"
@@ -1745,8 +1758,8 @@ msgid "All objects"
msgstr "All objects"
#. js-lingui-id: aFE/OW
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
#: src/modules/settings/roles/role-permissions/objects-permissions/components/SettingsRolePermissionsObjectsTableHeader.tsx
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
#: src/modules/settings/developers/components/WebhookEntitySelect.tsx
#: src/modules/settings/developers/components/WebhookEntitySelect.tsx
msgid "All Objects"
@@ -1911,6 +1924,11 @@ msgstr "An error occurred"
msgid "An error occurred while checking user existence"
msgstr "An error occurred while checking user existence"
+#. js-lingui-id: LfKkm6
+#: src/modules/page-layout/widgets/components/PageLayoutWidgetErrorDisplay.tsx
+msgid "An error occurred while loading this widget."
+msgstr "An error occurred while loading this widget."
+
#. js-lingui-id: I/scZd
#: src/modules/ai/components/AiChatErrorMessage.tsx
msgid "An error occurred while processing your message"
@@ -1979,11 +1997,6 @@ msgstr "An internal error occurred while validating your changes. Please contact
msgid "An object with this name already exists"
msgstr "An object with this name already exists"
-#. js-lingui-id: byKna+
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
-msgid "An unexpected error occurred. Please try again."
-msgstr "An unexpected error occurred. Please try again."
-
#. js-lingui-id: HZFm5R
#: src/utils/date-utils.ts
#: src/modules/settings/roles/role-settings/components/SettingsRoleSettingsDeleteRoleConfirmationModalSubtitle.tsx
@@ -1996,10 +2009,11 @@ msgstr "and"
msgid "And"
msgstr "And"
-#. js-lingui-id: KYvJeB
+#. js-lingui-id: 9BhGWn
+#. placeholder {0}: fieldLabel ?? ''
#: src/modules/object-record/advanced-filter/components/AdvancedFilterCompositeSubFieldSelectMenu.tsx
-msgid "Any {fieldLabel} field"
-msgstr "Any {fieldLabel} field"
+msgid "Any {0} field"
+msgstr "Any {0} field"
#. js-lingui-id: COyjuu
#: src/modules/side-panel/pages/page-layout/hooks/useVisibilityLabels.ts
@@ -2037,7 +2051,6 @@ msgstr "API & Webhooks"
#. js-lingui-id: yRnk5W
#: src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx
#: src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx
-#: src/pages/settings/ai/components/SettingsAiMCP.tsx
#: src/pages/settings/admin-panel/SettingsAdminNewAiProvider.tsx
#: src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx
#: src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx
@@ -2180,12 +2193,12 @@ msgid "Application installed successfully."
msgstr "Application installed successfully."
#. js-lingui-id: LllWIc
-#: src/pages/settings/security/event-logs/components/EventLogTableSelector.tsx
+#: src/modules/settings/event-logs/components/EventLogTableSelector.tsx
msgid "Application Logs"
msgstr "Application Logs"
#. js-lingui-id: l/T809
-#: src/pages/settings/applications/components/SettingsApplicationDetailTitle.tsx
+#: src/pages/settings/applications/SettingsAvailableApplicationDetails.tsx
msgid "Application not listed on the marketplace. It was shared via a direct link"
msgstr "Application not listed on the marketplace. It was shared via a direct link"
@@ -2281,12 +2294,6 @@ msgstr "Archive files cannot be previewed. Please download the file to access it
msgid "Archived"
msgstr "Archived"
-#. js-lingui-id: Yzbh3i
-#. placeholder {0}: emailingDomain.domain
-#: src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
-msgid "Are you sure you want to delete {0}? Outbound mail through this domain will stop working."
-msgstr "Are you sure you want to delete {0}? Outbound mail through this domain will stop working."
-
#. js-lingui-id: Faev6R
#: src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
msgid "Are you sure you want to delete {sourceHandle}? Inbound mail forwarded to this address and outbound replies from it will stop working."
@@ -2471,10 +2478,11 @@ msgstr "at {formattedTime}"
msgid "at {minuteNumStr} minutes past the hour"
msgstr "at {minuteNumStr} minutes past the hour"
-#. js-lingui-id: B4LoNY
+#. js-lingui-id: FNAAlz
+#. placeholder {0}: lastTime ?? ''
#: src/modules/workflow/workflow-trigger/utils/cron-to-human/descriptors/getHoursDescription.ts
-msgid "at {remainingTimes} and {lastTime}"
-msgstr "at {remainingTimes} and {lastTime}"
+msgid "at {remainingTimes} and {0}"
+msgstr "at {remainingTimes} and {0}"
#. js-lingui-id: MTsGe4
#: src/modules/workflow/workflow-trigger/utils/cron-to-human/descriptors/getMinutesDescription.ts
@@ -2506,10 +2514,11 @@ msgstr "At least one authentication method must be enabled"
msgid "at minutes {firstValue} and {secondValue}"
msgstr "at minutes {firstValue} and {secondValue}"
-#. js-lingui-id: r+gFlA
+#. js-lingui-id: VgeWVl
+#. placeholder {0}: lastValue ?? ''
#: src/modules/workflow/workflow-trigger/utils/cron-to-human/descriptors/getMinutesDescription.ts
-msgid "at minutes {remainingValues} and {lastValue}"
-msgstr "at minutes {remainingValues} and {lastValue}"
+msgid "at minutes {remainingValues} and {0}"
+msgstr "at minutes {remainingValues} and {0}"
#. js-lingui-id: PuQ8VT
#: src/modules/workflow/workflow-trigger/utils/cron-to-human/descriptors/getMinutesDescription.ts
@@ -2539,21 +2548,11 @@ msgid "Audit logs"
msgstr "Audit logs"
#. js-lingui-id: EPEFrH
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
+#: src/modules/settings/security/components/SettingsSecuritySettings.tsx
#: src/modules/settings/security/components/SettingsSecuritySettings.tsx
msgid "Audit Logs"
msgstr "Audit Logs"
-#. js-lingui-id: X0+U3u
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
-msgid "Audit logs are available with an Enterprise subscription. Please upgrade to access this feature."
-msgstr "Audit logs are available with an Enterprise subscription. Please upgrade to access this feature."
-
-#. js-lingui-id: rNQ4RB
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
-msgid "Audit logs require ClickHouse to be configured. Please contact your administrator to set up ClickHouse."
-msgstr "Audit logs require ClickHouse to be configured. Please contact your administrator to set up ClickHouse."
-
#. js-lingui-id: kIuOL4
#: src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerWebhookForm.tsx
msgid "Auth"
@@ -2688,10 +2687,10 @@ msgstr "Axis name"
msgid "Back"
msgstr "Back"
-#. js-lingui-id: VlP+1b
+#. js-lingui-id: wWjfh4
#: src/modules/ui/navigation/bread-crumb/components/MobileBreadcrumb.tsx
-msgid "Back to {linkText}"
-msgstr "Back to {linkText}"
+msgid "Back to {text}"
+msgstr "Back to {text}"
#. js-lingui-id: Dht9W3
#: src/pages/not-found/NotFound.tsx
@@ -2892,11 +2891,6 @@ msgstr "Browse partners"
msgid "BTREE (default, good for sorting and equality)"
msgstr "BTREE (default, good for sorting and equality)"
-#. js-lingui-id: vwZV+4
-#: src/modules/ai/components/suggested-prompts/default-suggested-prompts.ts
-msgid "Build a dashboard that shows: (1) total pipeline value by stage for the last 3 months, (2) count of deals won vs lost per month, (3) average deal size. Use our standard pipeline stages."
-msgstr "Build a dashboard that shows: (1) total pipeline value by stage for the last 3 months, (2) count of deals won vs lost per month, (3) average deal size. Use our standard pipeline stages."
-
#. js-lingui-id: pN5hZf
#: src/pages/settings/applications/tabs/SettingsApplicationFrontComponentSettingsTab.tsx
msgid "Build and runtime metadata for this component"
@@ -3072,6 +3066,16 @@ msgstr "Calendars"
msgid "Calling Code"
msgstr "Calling Code"
+#. js-lingui-id: 06mPlO
+#: src/modules/activities/emails/hooks/useSendMessageCampaign.ts
+msgid "Campaign queued to {queuedCount} recipient(s)"
+msgstr "Campaign queued to {queuedCount} recipient(s)"
+
+#. js-lingui-id: 6nG/xd
+#: src/modules/activities/emails/hooks/useSendMessageCampaign.ts
+msgid "Campaign queued to {queuedCount} recipient(s), {skippedCount} skipped"
+msgstr "Campaign queued to {queuedCount} recipient(s), {skippedCount} skipped"
+
#. js-lingui-id: msssZq
#: src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx
msgid "Can't change API names for standard objects"
@@ -3093,6 +3097,7 @@ msgstr "Can't scan? Copy the"
#: src/modules/spreadsheet-import/steps/components/MatchColumnsStep/MatchColumnsStep.tsx
#: src/modules/spreadsheet-import/provider/components/SpreadsheetImport.tsx
#: src/modules/side-panel/pages/compose-email/components/SidePanelComposeEmailPage.tsx
+#: src/modules/side-panel/pages/compose-campaign/components/SidePanelCampaignComposerPage.tsx
#: src/modules/settings/components/SaveAndCancelButtons/CancelButton.tsx
#: src/modules/settings/components/SaveAndCancelButtons/CancelButton.tsx
#: src/modules/object-record/record-update-multiple/components/UpdateMultipleRecordsFooter.tsx
@@ -3502,7 +3507,6 @@ msgid "ClickHouse is required for audit logs. Contact your administrator."
msgstr "ClickHouse is required for audit logs. Contact your administrator."
#. js-lingui-id: CTdw8/
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
#: src/pages/settings/ai/components/SettingsAiUsageTab.tsx
#: src/modules/settings/usage/components/SettingsUsageAnalyticsSection.tsx
msgid "ClickHouse Not Configured"
@@ -3583,12 +3587,12 @@ msgid "Code your function"
msgstr "Code your function"
#. js-lingui-id: H86f9p
-#: src/pages/settings/security/event-logs/components/EventLogJsonCell.tsx
#: src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx
#: src/modules/workflow/workflow-steps/components/WorkflowRunStepInputDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsToolCallRow.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsDetail.tsx
+#: src/modules/settings/event-logs/components/EventLogJsonCell.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJsonDataIndicatorHealthStatus.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
@@ -3831,6 +3835,11 @@ msgstr "Configure date, time, number, timezone, and calendar start day"
msgid "Configure fallback login methods for users with SSO bypass permissions"
msgstr "Configure fallback login methods for users with SSO bypass permissions"
+#. js-lingui-id: zXzR4W
+#: src/modules/settings/security/components/SettingsSecuritySettings.tsx
+msgid "Configure how long audit logs are retained"
+msgstr "Configure how long audit logs are retained"
+
#. js-lingui-id: OLqG0t
#: src/modules/settings/data-model/object-details/components/tabs/ObjectSettings.tsx
msgid "Configure how this object appears in search results"
@@ -3890,6 +3899,7 @@ msgstr "Configured"
#: src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx
#: src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx
#: src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
#: src/modules/ai/components/AIChatNoMoreBillingCreditsBanner.tsx
msgid "Confirm"
msgstr "Confirm"
@@ -4383,16 +4393,6 @@ msgstr "create"
msgid "Create"
msgstr "Create"
-#. js-lingui-id: 8aATyU
-#: src/modules/ai/components/suggested-prompts/default-suggested-prompts.ts
-msgid "Create a dashboard"
-msgstr "Create a dashboard"
-
-#. js-lingui-id: AR+f0K
-#: src/modules/ai/components/suggested-prompts/default-suggested-prompts.ts
-msgid "Create a dashboard with a chart of deal value by pipeline stage (New, Meeting, Proposal, Negotiation, Closed Won/Lost) for the current quarter, and a table of my top 10 open opportunities with amount, stage and expected close date."
-msgstr "Create a dashboard with a chart of deal value by pipeline stage (New, Meeting, Proposal, Negotiation, Closed Won/Lost) for the current quarter, and a table of my top 10 open opportunities with amount, stage and expected close date."
-
#. js-lingui-id: fQFALn
#: src/modules/ai/components/suggested-prompts/default-suggested-prompts.ts
msgid "Create a new contact and link them to a company. Details: "
@@ -5231,8 +5231,6 @@ msgid "delete"
msgstr "delete"
#. js-lingui-id: cnGeoo
-#: src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
-#: src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
#: src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
#: src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
#: src/pages/settings/developers/api-keys/SettingsDevelopersApiKeyDetail.tsx
@@ -5339,15 +5337,10 @@ msgstr "Delete app"
msgid "Delete chat"
msgstr "Delete chat"
-#. js-lingui-id: cC09EO
+#. js-lingui-id: 4xlcyV
#: src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
-msgid "Delete email handle"
-msgstr "Delete email handle"
-
-#. js-lingui-id: yZyuut
-#: src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
-msgid "Delete emailing domain"
-msgstr "Delete emailing domain"
+msgid "Delete email channel"
+msgstr "Delete email channel"
#. js-lingui-id: gf2eXy
#: src/pages/settings/ai/components/SettingsAgentEvalsTab.tsx
@@ -5568,11 +5561,11 @@ msgid "Detail per workspace"
msgstr "Detail per workspace"
#. js-lingui-id: URmyfc
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
#: src/pages/settings/layout/components/SettingsLayoutDetailScaffold.tsx
#: src/pages/settings/applications/SettingsApplicationConnectionDetail.tsx
#: src/pages/settings/applications/tabs/SettingsApplicationFrontComponentSettingsTab.tsx
#: src/pages/settings/applications/tabs/SettingsApplicationCommandMenuItemSettingsTab.tsx
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
#: src/modules/ai/components/RoutingDebugDisplay.tsx
msgid "Details"
msgstr "Details"
@@ -5602,6 +5595,11 @@ msgstr "Developers links"
msgid "Direction"
msgstr "Direction"
+#. js-lingui-id: XDeNvP
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Disable impersonation"
+msgstr "Disable impersonation"
+
#. js-lingui-id: E/QGRL
#: src/modules/page-layout/components/PageLayoutTabListNewTabDropdownContent.tsx
msgid "Disabled"
@@ -5695,8 +5693,7 @@ msgstr "Doesn't contain"
#. js-lingui-id: EoKe5U
#: src/pages/settings/security/SettingsSecurityApprovedAccessDomain.tsx
-#: src/pages/settings/emailing-domains/SettingsNewEmailingDomain.tsx
-#: src/modules/settings/workspace/components/SettingsWorkspaceEmailingDomainsSection.tsx
+#: src/modules/settings/workspace/components/SettingsWorkspaceEmailGroupSection.tsx
msgid "Domain"
msgstr "Domain"
@@ -5705,11 +5702,6 @@ msgstr "Domain"
msgid "Domain already taken"
msgstr "Domain already taken"
-#. js-lingui-id: OjtVhh
-#: src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
-msgid "Domain not found"
-msgstr "Domain not found"
-
#. js-lingui-id: XoBD/+
#: src/modules/settings/domains/components/SettingsDomainRecords.tsx
msgid "Domain Setup"
@@ -6089,8 +6081,6 @@ msgstr "else if"
#: src/pages/settings/profile/SettingsProfile.tsx
#: src/pages/settings/members/tabs/SettingsWorkspaceMembersTeamTab.tsx
#: src/pages/settings/members/tabs/SettingsWorkspaceMembersInviteTab.tsx
-#: src/pages/settings/emailing-domains/SettingsNewEmailingDomain.tsx
-#: src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
#: src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
#: src/pages/settings/email/SettingsWorkspaceEmail.tsx
#: src/pages/settings/email/SettingsWorkspaceEmail.tsx
@@ -6121,6 +6111,11 @@ msgstr "Email Address"
msgid "Email cannot be empty"
msgstr "Email cannot be empty"
+#. js-lingui-id: KHxfvN
+#: src/modules/settings/workspace/components/SettingsWorkspaceEmailGroupSection.tsx
+msgid "Email Channels"
+msgstr "Email Channels"
+
#. js-lingui-id: UZQ5eW
#: src/modules/object-record/record-table/record-table-cell/hooks/useGetSecondaryRecordTableCellButton.ts
#: src/modules/object-record/record-field/ui/meta-types/input/components/EmailsFieldInput.tsx
@@ -6133,11 +6128,6 @@ msgstr "Email copied to clipboard"
msgid "Email Editor"
msgstr "Email Editor"
-#. js-lingui-id: nsVRM/
-#: src/modules/settings/workspace/components/SettingsWorkspaceEmailGroupSection.tsx
-msgid "Email Handles"
-msgstr "Email Handles"
-
#. js-lingui-id: lfQsvW
#: src/pages/onboarding/internal/ChooseYourPlanContent.tsx
#: src/pages/onboarding/internal/ChooseYourPlanContent.tsx
@@ -6199,20 +6189,10 @@ msgstr "Email verified."
msgid "Email/Domain"
msgstr "Email/Domain"
-#. js-lingui-id: H2lcB9
-#: src/pages/settings/emailing-domains/SettingsNewEmailingDomain.tsx
-msgid "Emailing domain created successfully. Please verify the domain to start using it."
-msgstr "Emailing domain created successfully. Please verify the domain to start using it."
-
-#. js-lingui-id: XDpopO
-#: src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
-msgid "Emailing domain deleted successfully"
-msgstr "Emailing domain deleted successfully"
-
-#. js-lingui-id: axQccV
-#: src/modules/settings/workspace/components/SettingsWorkspaceEmailingDomainsSection.tsx
-msgid "Emailing Domains"
-msgstr "Emailing Domains"
+#. js-lingui-id: 4B3eAl
+#: src/pages/settings/email/SettingsWorkspaceEmail.tsx
+msgid "Emailing is in demo mode"
+msgstr "Emailing is in demo mode"
#. js-lingui-id: BXEcos
#: src/pages/settings/accounts/SettingsAccountsEmails.tsx
@@ -6227,6 +6207,11 @@ msgstr "Emails"
msgid "Emails and Calendar"
msgstr "Emails and Calendar"
+#. js-lingui-id: qryOF/
+#: src/pages/settings/email/SettingsWorkspaceEmail.tsx
+msgid "Emails are logged, not sent. Sending requires the AWS SES driver with an Enterprise license, or Twenty Cloud."
+msgstr "Emails are logged, not sent. Sending requires the AWS SES driver with an Enterprise license, or Twenty Cloud."
+
#. js-lingui-id: mHrqHa
#: src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx
msgid "Emails from the blocklist will be ignored. Manage blocklist on the \"Accounts\" setting page."
@@ -6262,12 +6247,12 @@ msgid "Empty"
msgstr "Empty"
#. js-lingui-id: OMbipf
-#: src/pages/settings/security/event-logs/components/EventLogJsonCell.tsx
#: src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx
#: src/modules/workflow/workflow-steps/components/WorkflowRunStepInputDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsToolCallRow.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsDetail.tsx
+#: src/modules/settings/event-logs/components/EventLogJsonCell.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJsonDataIndicatorHealthStatus.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
@@ -6286,12 +6271,12 @@ msgid "Empty Inbox"
msgstr "Empty Inbox"
#. js-lingui-id: 3hSGoJ
-#: src/pages/settings/security/event-logs/components/EventLogJsonCell.tsx
#: src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx
#: src/modules/workflow/workflow-steps/components/WorkflowRunStepInputDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsToolCallRow.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsDetail.tsx
+#: src/modules/settings/event-logs/components/EventLogJsonCell.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJsonDataIndicatorHealthStatus.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
@@ -6315,21 +6300,22 @@ msgstr "Empty tab"
msgid "Enable bypass options"
msgstr "Enable bypass options"
+#. js-lingui-id: Tt0V8j
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Enable impersonation"
+msgstr "Enable impersonation"
+
#. js-lingui-id: gZo0V9
#: src/modules/ai/components/SettingsAgentModelCapabilities.tsx
msgid "Enable model-specific features"
msgstr "Enable model-specific features"
#. js-lingui-id: IrI9pg
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
#: src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
msgid "End date"
msgstr "End date"
-#. js-lingui-id: VFv2ZC
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
-msgid "End Date"
-msgstr "End Date"
-
#. js-lingui-id: Fqu/aC
#: src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
msgid "End date must be after start date."
@@ -6504,6 +6490,11 @@ msgstr "Enter number between 1 and 60"
msgid "Enter number greater than 1"
msgstr "Enter number greater than 1"
+#. js-lingui-id: H4EIZl
+#: src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx
+msgid "Enter offset"
+msgstr "Enter offset"
+
#. js-lingui-id: /xM6j0
#: src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx
msgid "Enter one option per line"
@@ -6577,6 +6568,11 @@ msgstr "Enter value"
msgid "Enter values, comma-separated"
msgstr "Enter values, comma-separated"
+#. js-lingui-id: GDMzJS
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Enter your two-factor authentication code to confirm."
+msgstr "Enter your two-factor authentication code to confirm."
+
#. js-lingui-id: GpB8YV
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
@@ -6596,11 +6592,6 @@ msgstr "Enterprise"
msgid "Enterprise feature"
msgstr "Enterprise feature"
-#. js-lingui-id: Kjjkt3
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
-msgid "Enterprise Feature"
-msgstr "Enterprise Feature"
-
#. js-lingui-id: S5c4pl
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
@@ -6660,6 +6651,7 @@ msgstr "Erasure of soft-deleted records"
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsCodeDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsCodeDetail.tsx
#: src/modules/ui/feedback/snack-bar-manager/components/SnackBar.tsx
+#: src/modules/page-layout/widgets/components/PageLayoutWidgetErrorDisplay.tsx
msgid "Error"
msgstr "Error"
@@ -6698,11 +6690,6 @@ msgstr "Error editing SSO Identity Provider"
msgid "Error illustration"
msgstr "Error illustration"
-#. js-lingui-id: UJr0dl
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
-msgid "Error Loading Audit Logs"
-msgstr "Error Loading Audit Logs"
-
#. js-lingui-id: 9e/9KK
#: src/modules/activities/timeline-activities/rows/calendar/components/EventCardCalendarEvent.tsx
msgid "Error loading calendar event"
@@ -6728,10 +6715,11 @@ msgstr "Error opening billing portal"
msgid "Error opening Stripe"
msgstr "Error opening Stripe"
-#. js-lingui-id: bT/0cM
+#. js-lingui-id: bEAPCW
+#. placeholder {0}: String(error)
#: src/modules/ui/field/display/components/PhonesDisplay.tsx
-msgid "Error parsing additional phones: {error}"
-msgstr "Error parsing additional phones: {error}"
+msgid "Error parsing additional phones: {0}"
+msgstr "Error parsing additional phones: {0}"
#. js-lingui-id: zRXcyv
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
@@ -6845,16 +6833,15 @@ msgid "Evaluations"
msgstr "Evaluations"
#. js-lingui-id: 0pC/y6
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
#: src/modules/activities/calendar/components/CalendarEventDetails.tsx
msgid "Event"
msgstr "Event"
-#. js-lingui-id: ailPEn
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
-msgid "Event Type"
-msgstr "Event Type"
+#. js-lingui-id: cW8SdW
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
+msgid "Event type"
+msgstr "Event type"
#. js-lingui-id: poC90w
#: src/modules/settings/accounts/components/SettingsAccountsCalendarChannelDetails.tsx
@@ -6971,7 +6958,7 @@ msgid "Exclude the following people and domains from my email sync. Internal con
msgstr "Exclude the following people and domains from my email sync. Internal conversations will not be imported"
#. js-lingui-id: B0clc7
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
msgid "Execution ID"
msgstr "Execution ID"
@@ -7001,12 +6988,12 @@ msgid "Exit Settings"
msgstr "Exit Settings"
#. js-lingui-id: 1A3EXy
-#: src/pages/settings/security/event-logs/components/EventLogJsonCell.tsx
#: src/modules/workflow/workflow-steps/components/WorkflowRunStepOutputDetail.tsx
#: src/modules/workflow/workflow-steps/components/WorkflowRunStepInputDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsToolCallRow.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsDetail.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsDetail.tsx
+#: src/modules/settings/event-logs/components/EventLogJsonCell.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJsonDataIndicatorHealthStatus.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
@@ -7166,15 +7153,15 @@ msgstr "Failed to add model"
msgid "Failed to add provider"
msgstr "Failed to add provider"
-#. js-lingui-id: L9UnOU
+#. js-lingui-id: 5UH0/o
#: src/modules/settings/accounts/components/SettingsAccountsNewEmailGroupChannel.tsx
-msgid "Failed to create email handle. Email handles may not be configured on this server."
-msgstr "Failed to create email handle. Email handles may not be configured on this server."
+msgid "Failed to create email channel. Email channels may not be configured on this server."
+msgstr "Failed to create email channel. Email channels may not be configured on this server."
-#. js-lingui-id: lWoewm
+#. js-lingui-id: AXveCw
#: src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
-msgid "Failed to delete email handle."
-msgstr "Failed to delete email handle."
+msgid "Failed to delete email channel."
+msgstr "Failed to delete email channel."
#. js-lingui-id: pUligB
#: src/modules/settings/admin-panel/health-status/hooks/useDeleteJobs.ts
@@ -7226,6 +7213,11 @@ msgstr "Failed to install the application."
msgid "Failed to load front component: {errorMessage}"
msgstr "Failed to load front component: {errorMessage}"
+#. js-lingui-id: VxZSi+
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
+msgid "Failed to load server administrators."
+msgstr "Failed to load server administrators."
+
#. js-lingui-id: nKkohy
#: src/modules/settings/developers/hooks/useWebhookForm.ts
msgid "Failed to load webhook"
@@ -7289,6 +7281,12 @@ msgstr "Failed to save role permissions: {errorMessage}"
msgid "Failed to save workspace instructions"
msgstr "Failed to save workspace instructions"
+#. js-lingui-id: GpNLad
+#: src/modules/activities/emails/hooks/useSendMessageCampaign.ts
+#: src/modules/activities/emails/hooks/useSendMessageCampaign.ts
+msgid "Failed to send campaign"
+msgstr "Failed to send campaign"
+
#. js-lingui-id: Lo/GQ5
#: src/modules/activities/emails/hooks/useSendEmail.ts
#: src/modules/activities/emails/hooks/useSendEmail.ts
@@ -7353,6 +7351,11 @@ msgstr "Failed to update resource credits."
msgid "Failed to update role"
msgstr "Failed to update role"
+#. js-lingui-id: ahCOdw
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Failed to update server administrator access."
+msgstr "Failed to update server administrator access."
+
#. js-lingui-id: 204Qo2
#: src/modules/ai/components/AIChatNoMoreBillingCreditsBanner.tsx
msgid "Failed to upgrade credit plan."
@@ -7591,11 +7594,10 @@ msgstr "File field not found for attachment object"
msgid "File label"
msgstr "File label"
-#. js-lingui-id: QWWgBD
-#. placeholder {0}: file.label
+#. js-lingui-id: REA7PV
#: src/modules/ui/field/display/components/FileChip.tsx
-msgid "File no longer exists - {0}"
-msgstr "File no longer exists - {0}"
+msgid "File no longer exists - {label}"
+msgstr "File no longer exists - {label}"
#. js-lingui-id: ncBVqE
#: src/modules/object-record/record-field/ui/meta-types/hooks/useUploadFilesFieldFile.ts
@@ -7620,7 +7622,7 @@ msgid "Filter"
msgstr "Filter"
#. js-lingui-id: LjNPDA
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
msgid "Filter by event"
msgstr "Filter by event"
@@ -7630,7 +7632,7 @@ msgid "Filter by object type"
msgstr "Filter by object type"
#. js-lingui-id: gVEHcL
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
msgid "Filter by record ID"
msgstr "Filter by record ID"
@@ -7827,6 +7829,7 @@ msgstr "French"
#. js-lingui-id: ejVYRQ
#: src/modules/activities/emails/components/EmailComposerFields.tsx
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
msgid "From"
msgstr "From"
@@ -7871,13 +7874,23 @@ msgstr "Front Components"
msgid "Full access"
msgstr "Full access"
+#. js-lingui-id: aerYcp
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "full admin panel access"
+msgstr "full admin panel access"
+
+#. js-lingui-id: CU/Sq6
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "full server access"
+msgstr "full server access"
+
#. js-lingui-id: Ld0Tt4
#: src/modules/side-panel/components/hooks/usePageLayoutHeaderInfo.ts
msgid "Full tab widget"
msgstr "Full tab widget"
#. js-lingui-id: YMZBxa
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
msgid "Function"
msgstr "Function"
@@ -7973,11 +7986,6 @@ msgstr "GIN (full-text search and JSONB)"
msgid "Global search"
msgstr "Global search"
-#. js-lingui-id: sr0UJD
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
-msgid "Go Back"
-msgstr "Go Back"
-
#. js-lingui-id: Hb4Cgz
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
@@ -8013,11 +8021,26 @@ msgstr "Google"
msgid "Google OIDC"
msgstr "Google OIDC"
+#. js-lingui-id: P1Rw/Z
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Grant access"
+msgstr "Grant access"
+
#. js-lingui-id: 6eo66Q
#: src/modules/settings/workspace/components/ToggleImpersonate.tsx
msgid "Grant access to your workspace so we can troubleshoot problems."
msgstr "Grant access to your workspace so we can troubleshoot problems."
+#. js-lingui-id: 3xMv4O
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Grant admin panel access"
+msgstr "Grant admin panel access"
+
+#. js-lingui-id: FdPN4f
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Grant full access"
+msgstr "Grant full access"
+
#. js-lingui-id: WUgtid
#: src/modules/settings/roles/role-permissions/object-level-permissions/object-form/components/SettingsRolePermissionsObjectLevelObjectFormObjectLevelTableRow.tsx
msgid "Granted for this object"
@@ -8230,10 +8253,11 @@ msgstr "Hide empty category"
msgid "Hide empty groups"
msgstr "Hide empty groups"
-#. js-lingui-id: hjH2V9
+#. js-lingui-id: CbeJV4
+#. placeholder {0}: groupValue ?? ''
#: src/modules/object-record/record-group/components/RecordGroupMenuItemDraggable.tsx
-msgid "Hide group {groupValue}"
-msgstr "Hide group {groupValue}"
+msgid "Hide group {0}"
+msgstr "Hide group {0}"
#. js-lingui-id: wgmt7A
#: src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
@@ -8415,11 +8439,6 @@ msgstr "Human Input"
msgid "Hungarian"
msgstr "Hungarian"
-#. js-lingui-id: YUJ1ey
-#: src/modules/ai/components/suggested-prompts/default-suggested-prompts.ts
-msgid "I need a dashboard for lead conversion: number of new leads by source this month, how many moved to opportunity, and conversion rate by source. Include a simple table and a bar chart."
-msgstr "I need a dashboard for lead conversion: number of new leads by source this month, how many moved to opportunity, and conversion rate by source. Include a simple table and a bar chart."
-
#. js-lingui-id: VNC0Db
#: src/modules/settings/admin-panel/ai/components/SettingsAdminAiProviderListCard.tsx
msgid "IAM credentials"
@@ -8567,6 +8586,17 @@ msgstr "Impersonate"
msgid "Impersonate workspace users"
msgstr "Impersonate workspace users"
+#. js-lingui-id: 1ZMDWV
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "impersonation"
+msgstr "impersonation"
+
+#. js-lingui-id: gFoGWm
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Impersonation"
+msgstr "Impersonation"
+
#. js-lingui-id: yImXof
#: src/pages/settings/admin-panel/SettingsAdminUserDetail.tsx
msgid "Impersonation is disabled for this workspace"
@@ -8848,10 +8878,10 @@ msgstr "Invalid auth provider"
msgid "Invalid Configuration"
msgstr "Invalid Configuration"
-#. js-lingui-id: fSwqXe
+#. js-lingui-id: SEpkD6
#: src/modules/page-layout/widgets/components/PageLayoutWidgetInvalidConfigDisplay.tsx
-msgid "Invalid configuration. Click edit to configure this widget."
-msgstr "Invalid configuration. Click edit to configure this widget."
+msgid "Invalid configuration: {errorMessage}"
+msgstr "Invalid configuration: {errorMessage}"
#. js-lingui-id: ER/0YT
#: src/modules/workflow/workflow-trigger/utils/getTriggerScheduleDescription.ts
@@ -9549,7 +9579,7 @@ msgid "Less than or equal"
msgstr "Less than or equal"
#. js-lingui-id: oCHfGC
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
msgid "Level"
msgstr "Level"
@@ -9724,8 +9754,8 @@ msgid "Loading metrics data..."
msgstr "Loading metrics data..."
#. js-lingui-id: tVSmFT
-#: src/pages/settings/security/event-logs/components/EventLogResultsTable.tsx
#: src/modules/ui/input/components/IconPicker.tsx
+#: src/modules/settings/event-logs/components/EventLogResultsTable.tsx
#: src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerFetchMoreLoader.tsx
#: src/modules/activities/components/CustomResolverFetchMoreLoader.tsx
msgid "Loading more..."
@@ -9747,7 +9777,6 @@ msgid "Loading thread"
msgstr "Loading thread"
#. js-lingui-id: Z3FXyt
-#: src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
#: src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentEntityPickerDropdown.tsx
#: src/modules/settings/admin-panel/components/SettingsAdminVersionDisplay.tsx
#: src/modules/activities/timeline-activities/rows/message/components/EventCardMessage.tsx
@@ -9818,6 +9847,7 @@ msgid "Logout"
msgstr "Logout"
#. js-lingui-id: w/bY7R
+#: src/pages/settings/general/SettingsGeneral.tsx
#: src/pages/settings/ai/SettingsAgentForm.tsx
#: src/modules/side-panel/pages/workflow/step/view-run/components/SidePanelWorkflowRunViewStepContent.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminJobDetailsExpandable.tsx
@@ -9825,6 +9855,11 @@ msgstr "Logout"
msgid "Logs"
msgstr "Logs"
+#. js-lingui-id: MspNoT
+#: src/modules/settings/event-logs/components/SettingsLogs.tsx
+msgid "Logs require ClickHouse to be configured. Please contact your administrator."
+msgstr "Logs require ClickHouse to be configured. Please contact your administrator."
+
#. js-lingui-id: FJBbw5
#: src/modules/object-metadata/hooks/useSortSubFieldChoicesForField.ts
msgid "Longitude"
@@ -9961,10 +9996,11 @@ msgstr "Manual"
msgid "Marketplace"
msgstr "Marketplace"
-#. js-lingui-id: FCc+QF
+#. js-lingui-id: 8r6vNs
+#. placeholder {0}: fieldLabel ?? ''
#: src/modules/spreadsheet-import/steps/components/MatchColumnsStep/components/UnmatchColumn.tsx
-msgid "Match {fieldLabel} ({unmatchedCount} Unmatched)"
-msgstr "Match {fieldLabel} ({unmatchedCount} Unmatched)"
+msgid "Match {0} ({unmatchedCount} Unmatched)"
+msgstr "Match {0} ({unmatchedCount} Unmatched)"
#. js-lingui-id: gDLior
#: src/modules/spreadsheet-import/steps/components/SpreadsheetImportStepperContainer.tsx
@@ -10034,14 +10070,8 @@ msgstr "MCP"
msgid "MCP config copied to clipboard"
msgstr "MCP config copied to clipboard"
-#. js-lingui-id: NvQoNb
-#: src/pages/settings/ai/components/SettingsAiMCP.tsx
-msgid "MCP Configuration copied to clipboard"
-msgstr "MCP Configuration copied to clipboard"
-
#. js-lingui-id: 8CWirf
#: src/pages/settings/ai/components/SettingsAiOverviewTab.tsx
-#: src/pages/settings/ai/components/SettingsAiMCP.tsx
msgid "MCP Server"
msgstr "MCP Server"
@@ -10115,7 +10145,7 @@ msgid "Merging..."
msgstr "Merging..."
#. js-lingui-id: xDAtGP
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
msgid "Message"
msgstr "Message"
@@ -10603,6 +10633,11 @@ msgstr "New AI Provider"
msgid "New Approved Access Domain"
msgstr "New Approved Access Domain"
+#. js-lingui-id: yGfI61
+#: src/modules/side-panel/hooks/useOpenCampaignComposerInSidePanel.ts
+msgid "New Campaign"
+msgstr "New Campaign"
+
#. js-lingui-id: hIQkLb
#: src/modules/navigation/components/MainNavigationDrawerTabsRow.tsx
#: src/modules/navigation/components/MainNavigationDrawerTabsRow.tsx
@@ -10626,27 +10661,26 @@ msgstr "New conversation"
msgid "New Email"
msgstr "New Email"
-#. js-lingui-id: VJZNJt
+#. js-lingui-id: papEbS
#: src/modules/settings/accounts/components/SettingsAccountsNewEmailGroupChannel.tsx
#: src/modules/settings/accounts/components/SettingsAccountsNewEmailGroupChannel.tsx
-msgid "New Email Handle"
-msgstr "New Email Handle"
-
-#. js-lingui-id: wqoYqp
-#: src/pages/settings/emailing-domains/SettingsNewEmailingDomain.tsx
-#: src/pages/settings/emailing-domains/SettingsNewEmailingDomain.tsx
-msgid "New Emailing Domain"
-msgstr "New Emailing Domain"
+msgid "New Email Channel"
+msgstr "New Email Channel"
#. js-lingui-id: k6B3QD
#: src/modules/navigation-menu-item/display/sections/favorites/components/FavoritesSection.tsx
msgid "New favorite"
msgstr "New favorite"
+#. js-lingui-id: kV1LSq
+#: src/pages/settings/data-model/new-field/SettingsObjectNewFieldSelect.tsx
+#: src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsx
+msgid "New field"
+msgstr "New field"
+
#. js-lingui-id: 8YPqRx
#: src/pages/settings/data-model/SettingsObjectDetailPage.tsx
#: src/modules/settings/data-model/fields/forms/number/components/SettingsDataModelFieldNumberSettingsFormCard.tsx
-#: src/modules/settings/data-model/components/SettingsDataModelNewFieldBreadcrumbDropDown.tsx
msgid "New Field"
msgstr "New Field"
@@ -10816,6 +10850,11 @@ msgstr "No {label}"
msgid "No {objectLabelSingular} found"
msgstr "No {objectLabelSingular} found"
+#. js-lingui-id: oPoLg+
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "No access"
+msgstr "No access"
+
#. js-lingui-id: glQp+P
#: src/modules/settings/admin-panel/components/SettingsAdminWorkspaceBillingContent.tsx
msgid "No active subscription."
@@ -11039,7 +11078,7 @@ msgid "No evaluations yet for this turn"
msgstr "No evaluations yet for this turn"
#. js-lingui-id: SIR5Ix
-#: src/pages/settings/security/event-logs/components/EventLogResultsTable.tsx
+#: src/modules/settings/event-logs/components/EventLogResultsTable.tsx
msgid "No event logs found"
msgstr "No event logs found"
@@ -11064,7 +11103,7 @@ msgid "No field configured"
msgstr "No field configured"
#. js-lingui-id: /hvarH
-#: src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionRelationFieldView.tsx
+#: src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
msgid "No fields available"
msgstr "No fields available"
@@ -11237,6 +11276,11 @@ msgstr "No permissions configured for this application."
msgid "No permissions have been set for individual objects."
msgstr "No permissions have been set for individual objects."
+#. js-lingui-id: 5sv+ia
+#: src/modules/activities/emails/hooks/useSendMessageCampaign.ts
+msgid "No recipients to send to ({skippedCount} skipped)"
+msgstr "No recipients to send to ({skippedCount} skipped)"
+
#. js-lingui-id: V/+aTW
#: src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
#: src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordFieldChip.tsx
@@ -11324,6 +11368,11 @@ msgstr "No rows with errors"
msgid "No Select field"
msgstr "No Select field"
+#. js-lingui-id: JkPTT8
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
+msgid "No server administrators found."
+msgstr "No server administrators found."
+
#. js-lingui-id: RQ6tfU
#: src/modules/navigation-menu-item/edit/side-panel/components/SidePanelSystemObjectPickerSubView.tsx
msgid "No system objects available"
@@ -11334,6 +11383,11 @@ msgstr "No system objects available"
msgid "No system objects with views found"
msgstr "No system objects with views found"
+#. js-lingui-id: L4Miic
+#: src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionMorphRelationFieldView.tsx
+msgid "No targets available"
+msgstr "No targets available"
+
#. js-lingui-id: t0t36i
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsAiAgentDetail.tsx
msgid "No tools were called"
@@ -11560,6 +11614,11 @@ msgstr "Number of decimals"
msgid "Number of new credits allocated every {recurringInterval}"
msgstr "Number of new credits allocated every {recurringInterval}"
+#. js-lingui-id: n49P/Y
+#: src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx
+msgid "Number of records to skip. Combine with Limit to page through results."
+msgstr "Number of records to skip. Combine with Limit to page through results."
+
#. js-lingui-id: qg5nhQ
#: src/modules/settings/data-model/fields/forms/number/components/SettingsDataModelFieldNumberForm.tsx
msgid "Number type"
@@ -11578,7 +11637,6 @@ msgstr "Numbered list"
#. js-lingui-id: b/j06W
#: src/pages/settings/applications/SettingsApplicationRegistrationDetails.tsx
#: src/pages/settings/applications/tabs/SettingsApplicationRegistrationOAuthTab.tsx
-#: src/pages/settings/ai/components/SettingsAiMCP.tsx
#: src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDetail.tsx
msgid "OAuth"
msgstr "OAuth"
@@ -11630,12 +11688,12 @@ msgid "Object destination"
msgstr "Object destination"
#. js-lingui-id: /clmEa
-#: src/pages/settings/security/event-logs/components/EventLogTableSelector.tsx
+#: src/modules/settings/event-logs/components/EventLogTableSelector.tsx
msgid "Object Events"
msgstr "Object Events"
#. js-lingui-id: 79D4Az
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
msgid "Object ID"
msgstr "Object ID"
@@ -11654,10 +11712,10 @@ msgstr "object permission"
msgid "Object permission options"
msgstr "Object permission options"
-#. js-lingui-id: UGhVPl
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
-msgid "Object Type"
-msgstr "Object Type"
+#. js-lingui-id: gaqIMK
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
+msgid "Object type"
+msgstr "Object type"
#. js-lingui-id: rDycBw
#: src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx
@@ -11715,6 +11773,16 @@ msgstr "of"
msgid "Off the beaten path"
msgstr "Off the beaten path"
+#. js-lingui-id: Zd5vVt
+#: src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx
+msgid "Offset"
+msgstr "Offset"
+
+#. js-lingui-id: xV4QQm
+#: src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowEditActionFindRecords.tsx
+msgid "Offset cannot be negative."
+msgstr "Offset cannot be negative."
+
#. js-lingui-id: ec0+nM
#: src/modules/advanced-text-editor/extensions/slash-command/DefaultSlashCommands.ts
msgid "ol"
@@ -11750,10 +11818,11 @@ msgstr "on the {ordinal} {dayName} of the month"
msgid "on the {ordinalDay} of the month"
msgstr "on the {ordinalDay} of the month"
-#. js-lingui-id: Q4spp9
+#. js-lingui-id: P5MEzQ
+#. placeholder {0}: lastDay ?? ''
#: src/modules/workflow/workflow-trigger/utils/cron-to-human/descriptors/getDayOfMonthDescription.ts
-msgid "on the {remainingDays} and {lastDay} of the month"
-msgstr "on the {remainingDays} and {lastDay} of the month"
+msgid "on the {remainingDays} and {0} of the month"
+msgstr "on the {remainingDays} and {0} of the month"
#. js-lingui-id: aJ++Ko
#: src/modules/workflow/workflow-trigger/utils/cron-to-human/descriptors/getDayOfWeekDescription.ts
@@ -11791,6 +11860,11 @@ msgstr "On which object(s) should this trigger be available"
msgid "Onboarding call"
msgstr "Onboarding call"
+#. js-lingui-id: oFTo3P
+#: src/modules/settings/event-logs/components/SettingsLogs.tsx
+msgid "Only application logs are available on your current plan. Other log types require an Enterprise subscription."
+msgstr "Only application logs are available on your current plan. Other log types require an Enterprise subscription."
+
#. js-lingui-id: zii2Qj
#: src/modules/settings/accounts/components/SettingsAccountsCalendarVisibilitySettingsCard.tsx
msgid "Only date & participants will be shared with your team."
@@ -11807,10 +11881,11 @@ msgstr "only in {firstMonth} and {secondMonth}"
msgid "only in {monthName}"
msgstr "only in {monthName}"
-#. js-lingui-id: nZ4jBc
+#. js-lingui-id: VKB4PB
+#. placeholder {0}: lastMonth ?? ''
#: src/modules/workflow/workflow-trigger/utils/cron-to-human/descriptors/getMonthsDescription.ts
-msgid "only in {remainingMonths} and {lastMonth}"
-msgstr "only in {remainingMonths} and {lastMonth}"
+msgid "only in {remainingMonths} and {0}"
+msgstr "only in {remainingMonths} and {0}"
#. js-lingui-id: G+ijJ2
#: src/modules/workflow/workflow-trigger/utils/cron-to-human/descriptors/getDayOfWeekDescription.ts
@@ -11823,10 +11898,11 @@ msgstr "only on {dayName}"
msgid "only on {firstDay} and {secondDay}"
msgstr "only on {firstDay} and {secondDay}"
-#. js-lingui-id: pYaMbU
+#. js-lingui-id: ODid5C
+#. placeholder {0}: lastDay ?? ''
#: src/modules/workflow/workflow-trigger/utils/cron-to-human/descriptors/getDayOfWeekDescription.ts
-msgid "only on {remainingDays} and {lastDay}"
-msgstr "only on {remainingDays} and {lastDay}"
+msgid "only on {remainingDays} and {0}"
+msgstr "only on {remainingDays} and {0}"
#. js-lingui-id: saaSLd
#: src/modules/activities/emails/components/EmailThreadNotShared.tsx
@@ -12042,6 +12118,11 @@ msgstr "Our team can help you set up your workspace to match your specific needs
msgid "Outage"
msgstr "Outage"
+#. js-lingui-id: nvADne
+#: src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
+msgid "Outbound mail from this channel is sent through this domain. It must be verified before email can be delivered."
+msgstr "Outbound mail from this channel is sent through this domain. It must be verified before email can be delivered."
+
#. js-lingui-id: gh06VD
#: src/pages/settings/admin-panel/SettingsAdminNewAiModel.tsx
#: src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowOutputSchemaBuilder.tsx
@@ -12130,10 +12211,10 @@ msgstr "page layout widget"
msgid "Page layouts"
msgstr "Page layouts"
-#. js-lingui-id: IVBjIH
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
-msgid "Page Name"
-msgstr "Page Name"
+#. js-lingui-id: zQF6Kb
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
+msgid "Page name"
+msgstr "Page name"
#. js-lingui-id: NRvxzv
#: src/pages/not-found/NotFound.tsx
@@ -12141,7 +12222,7 @@ msgid "Page Not Found | Twenty"
msgstr "Page Not Found | Twenty"
#. js-lingui-id: sF+Xp9
-#: src/pages/settings/security/event-logs/components/EventLogTableSelector.tsx
+#: src/modules/settings/event-logs/components/EventLogTableSelector.tsx
msgid "Page Views"
msgstr "Page Views"
@@ -12219,6 +12300,11 @@ msgstr "Paste your enterprise key here"
msgid "Path"
msgstr "Path"
+#. js-lingui-id: IgrLD/
+#: src/modules/settings/event-logs/components/SettingsLogs.tsx
+msgid "Pause"
+msgstr "Pause"
+
#. js-lingui-id: QmXBEc
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
msgid "Payment issue"
@@ -12285,6 +12371,11 @@ msgstr "Percentage"
msgid "Perform administrative actions or permanently delete this user"
msgstr "Perform administrative actions or permanently delete this user"
+#. js-lingui-id: NtQvjo
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
+msgid "Period"
+msgstr "Period"
+
#. js-lingui-id: wSpwGR
#: src/modules/settings/security/components/SettingsSecuritySettings.tsx
msgid "Permanent deletion. Enter the number of days."
@@ -12681,8 +12772,7 @@ msgid "Prompt"
msgstr "Prompt"
#. js-lingui-id: l/UFPv
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
msgid "Properties"
msgstr "Properties"
@@ -12997,8 +13087,8 @@ msgid "Record filter rule options"
msgstr "Record filter rule options"
#. js-lingui-id: xSAYIn
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
msgid "Record ID"
msgstr "Record ID"
@@ -13077,11 +13167,6 @@ msgstr "Redirect Url copied to clipboard"
msgid "Redirection URI"
msgstr "Redirection URI"
-#. js-lingui-id: lCF0wC
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
-msgid "Refresh"
-msgstr "Refresh"
-
#. js-lingui-id: pTGa/J
#: src/pages/settings/admin-panel/SettingsAdminWorkspacesStatus.tsx
#: src/pages/settings/admin-panel/SettingsAdminInstanceStatus.tsx
@@ -13259,7 +13344,7 @@ msgid "Remove provider"
msgstr "Remove provider"
#. js-lingui-id: hJ4+Zq
-#. placeholder {0}: provider?.label ?? providerName
+#. placeholder {0}: provider?.label ?? providerName ?? ''
#: src/pages/settings/admin-panel/SettingsAdminAiProviderDetail.tsx
msgid "Remove provider \"{0}\""
msgstr "Remove provider \"{0}\""
@@ -13445,7 +13530,7 @@ msgid "Resource credits updated."
msgstr "Resource credits updated."
#. js-lingui-id: esl+Tv
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
msgid "Resource Type"
msgstr "Resource Type"
@@ -13517,6 +13602,7 @@ msgstr "Results"
#. js-lingui-id: v39wLo
#: src/modules/workflow/workflow-steps/workflow-actions/delay-actions/components/WorkflowEditActionDelay.tsx
+#: src/modules/settings/event-logs/components/SettingsLogs.tsx
msgid "Resume"
msgstr "Resume"
@@ -13548,6 +13634,16 @@ msgstr "reverse alphabetical"
msgid "Revoke"
msgstr "Revoke"
+#. js-lingui-id: cg+Poy
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Revoke access"
+msgstr "Revoke access"
+
+#. js-lingui-id: iu5Egq
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Revoke admin panel access"
+msgstr "Revoke admin panel access"
+
#. js-lingui-id: rJrWw4
#: src/modules/settings/admin-panel/signing-keys/components/SettingsAdminRevokeSigningKeyConfirmationModal.tsx
msgid "Revoke signing key"
@@ -13744,6 +13840,7 @@ msgid "Saturday"
msgstr "Saturday"
#. js-lingui-id: tfDRzk
+#: src/pages/settings/data-model/new-field/SettingsObjectNewFieldConfigure.tsx
#: src/modules/settings/components/SaveAndCancelButtons/SaveButton.tsx
msgid "Save"
msgstr "Save"
@@ -13980,7 +14077,7 @@ msgstr "Search currency"
#: src/modules/views/components/ViewBarFilterDropdownFieldSelectMenu.tsx
#: src/modules/spreadsheet-import/components/MatchColumnSelectFieldSelectDropdownContent.tsx
#: src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx
-#: src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionRelationFieldView.tsx
+#: src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
#: src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
#: src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx
#: src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderPlusButtonContent.tsx
@@ -14120,7 +14217,6 @@ msgstr "Secret Access Key"
#. js-lingui-id: a3LDKx
#: src/pages/settings/security/SettingsSecuritySSOIdentifyProvider.tsx
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
#: src/pages/settings/general/SettingsGeneral.tsx
#: src/modules/settings/roles/role-permissions/permission-flags/hooks/useSettingsRolePermissionFlagConfig.ts
msgid "Security"
@@ -14245,6 +14341,11 @@ msgstr "Select a known provider or create a custom one"
msgid "Select a navigation item to edit"
msgstr "Select a navigation item to edit"
+#. js-lingui-id: YkYui1
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
+msgid "Select a sender"
+msgstr "Select a sender"
+
#. js-lingui-id: jL3gox
#: src/modules/object-record/record-field/ui/form-types/components/FormBooleanFieldInput.tsx
msgid "Select a value"
@@ -14403,6 +14504,11 @@ msgstr "Send"
msgid "Send an invite email to your team"
msgstr "Send an invite email to your team"
+#. js-lingui-id: WRLt0i
+#: src/modules/side-panel/pages/compose-campaign/components/SidePanelCampaignComposerPage.tsx
+msgid "Send campaign"
+msgstr "Send campaign"
+
#. js-lingui-id: 65dxv8
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsEmailDetail.tsx
msgid "Send email"
@@ -14419,6 +14525,11 @@ msgstr "Send Email"
msgid "Send emails via connected accounts"
msgstr "Send emails via connected accounts"
+#. js-lingui-id: ULtHaJ
+#: src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
+msgid "Sending domain"
+msgstr "Sending domain"
+
#. js-lingui-id: asU5VT
#: src/modules/workflow/workflow-steps/workflow-actions/http-request-action/components/HttpRequestExecutionResult.tsx
msgid "Sending request..."
@@ -14446,6 +14557,16 @@ msgstr "Sent and Received"
msgid "Serbian (Cyrillic)"
msgstr "Serbian (Cyrillic)"
+#. js-lingui-id: hjUUtd
+#: src/pages/settings/admin-panel/SettingsAdminUserDetail.tsx
+msgid "Server access"
+msgstr "Server access"
+
+#. js-lingui-id: 4Fpy78
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "Server administrator access updated."
+msgstr "Server administrator access updated."
+
#. js-lingui-id: fHVf32
#: src/pages/settings/applications/tabs/SettingsApplicationRegistrationConfigTab.tsx
msgid "Server Variables"
@@ -14666,10 +14787,11 @@ msgstr "Should changing the label also change the API name?"
msgid "show all"
msgstr "show all"
-#. js-lingui-id: lSEpDc
+#. js-lingui-id: JObkI8
+#. placeholder {0}: groupValue ?? ''
#: src/modules/object-record/record-group/components/RecordGroupMenuItemDraggable.tsx
-msgid "Show group {groupValue}"
-msgstr "Show group {groupValue}"
+msgid "Show group {0}"
+msgstr "Show group {0}"
#. js-lingui-id: 1OVrop
#: src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
@@ -14925,6 +15047,11 @@ msgstr "Some log data was dropped to fit the size limit ({0} entries, {1} bytes)
msgid "Something went wrong"
msgstr "Something went wrong"
+#. js-lingui-id: teokEm
+#: src/modules/settings/event-logs/components/SettingsLogs.tsx
+msgid "Something went wrong while loading logs. Please try again."
+msgstr "Something went wrong while loading logs. Please try again."
+
#. js-lingui-id: yHwG3y
#: src/modules/ui/navigation/navigation-drawer/components/NavigationDrawerItem.tsx
#: src/modules/settings/components/SettingsCard.tsx
@@ -15080,15 +15207,11 @@ msgid "Start a new enterprise subscription."
msgstr "Start a new enterprise subscription."
#. js-lingui-id: WAjFYI
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
#: src/modules/settings/admin-panel/health-status/maintenance-mode/components/SettingsAdminMaintenanceMode.tsx
msgid "Start date"
msgstr "Start date"
-#. js-lingui-id: D3iCkb
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
-msgid "Start Date"
-msgstr "Start Date"
-
#. js-lingui-id: s+K73L
#: src/modules/settings/billing/components/SettingsBillingSubscriptionInfo.tsx
#: src/modules/ai/components/AIChatNoMoreBillingCreditsBanner.tsx
@@ -15121,7 +15244,6 @@ msgstr "State"
#: src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
#: src/pages/settings/admin-panel/SettingsAdminInstanceStatus.tsx
#: src/pages/settings/admin-panel/SettingsAdminIndicatorHealthStatus.tsx
-#: src/modules/settings/workspace/components/SettingsWorkspaceEmailingDomainsSection.tsx
#: src/modules/settings/components/SettingsDnsRecordsTable.tsx
#: src/modules/settings/admin-panel/signing-keys/components/SettingsAdminSigningKeysTable.tsx
#: src/modules/settings/admin-panel/components/SettingsAdminWorkspaceContent.tsx
@@ -15230,6 +15352,8 @@ msgstr "subheading"
#: src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionEmailBase.tsx
#: src/modules/activities/emails/components/EmailComposerFields.tsx
#: src/modules/activities/emails/components/EmailComposerFields.tsx
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
msgid "Subject"
msgstr "Subject"
@@ -15522,12 +15646,12 @@ msgid "Tab Settings"
msgstr "Tab Settings"
#. js-lingui-id: 4hJhzz
-#: src/pages/settings/security/event-logs/components/EventLogTableSelector.tsx
#: src/pages/settings/layout/SettingsLayoutViewDetail.tsx
#: src/modules/views/view-picker/constants/ViewPickerTypeSelectOptions.ts
#: src/modules/side-panel/pages/page-layout/components/record-page/SidePanelRecordPageFieldSettings.tsx
#: src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetLayoutDropdownContent.tsx
#: src/modules/side-panel/pages/page-layout/components/dashboard/SidePanelDashboardRecordTableSettings.tsx
+#: src/modules/settings/event-logs/components/EventLogTableSelector.tsx
#: src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownLayoutContent.tsx
#: src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuOpenContent.tsx
msgid "Table"
@@ -15724,11 +15848,6 @@ msgstr "The default country for new addresses"
msgid "The description of this field"
msgstr "The description of this field"
-#. js-lingui-id: HUoA4b
-#: src/pages/settings/emailing-domains/SettingsNewEmailingDomain.tsx
-msgid "The domain name you want to use for emailing"
-msgstr "The domain name you want to use for emailing"
-
#. js-lingui-id: xJSPh6
#: src/modules/settings/members/components/MemberInfosTab.tsx
msgid "The email associated to this account"
@@ -15785,6 +15904,11 @@ msgstr "The selected record will be passed to your workflow"
msgid "The selected records (up to {maxRecordsFormatted}) will be passed to your workflow"
msgstr "The selected records (up to {maxRecordsFormatted}) will be passed to your workflow"
+#. js-lingui-id: tLJLok
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
+msgid "The unsubscribe group this email belongs to. Recipients who opted out of it are skipped, and the unsubscribe link is scoped to it."
+msgstr "The unsubscribe group this email belongs to. Recipients who opted out of it are skipped, and the unsubscribe link is scoped to it."
+
#. js-lingui-id: uWikAA
#: src/pages/settings/data-model/SettingsObjectFieldEdit.tsx
msgid "The values of this field"
@@ -16036,6 +16160,11 @@ msgstr "This role is assigned to these {roleTargetDisplayName}."
msgid "This role is shared with other users or agents and cannot be edited here."
msgstr "This role is shared with other users or agents and cannot be edited here."
+#. js-lingui-id: w8O8Ja
+#: src/modules/side-panel/pages/page-layout/components/ChartFiltersDeletedFieldsWarning.tsx
+msgid "This rule filters on one or more deleted fields that should be removed."
+msgstr "This rule filters on one or more deleted fields that should be removed."
+
#. js-lingui-id: C/wr0z
#: src/modules/settings/admin-panel/config-variables/components/ConfigVariableHelpText.tsx
msgid "This setting can only be configured through environment variables."
@@ -16105,6 +16234,12 @@ msgstr "This will disconnect {connectionLabel} from this application."
msgid "This will disconnect all models from this provider. Models will no longer be available until a new provider is configured."
msgstr "This will disconnect all models from this provider. Models will no longer be available until a new provider is configured."
+#. js-lingui-id: XZWXeK
+#. placeholder {0}: pendingChange?.description ?? ''
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "This will grant {0} to {userLabel}."
+msgstr "This will grant {0} to {userLabel}."
+
#. js-lingui-id: y8xx3L
#: src/modules/object-record/record-update-multiple/components/UpdateMultipleRecordsContainer.tsx
msgid "This will modify {contextStoreNumberOfSelectedRecords} records. This action cannot be undone."
@@ -16125,6 +16260,12 @@ msgstr "This will permanently delete the object and all its records. Type \"yes\
msgid "This will permanently delete your two factor authentication method.<0/>Since 2FA is mandatory in your workspace, you will be logged out after deletion and will be asked to configure it again upon login. <1/>Please type in your email to confirm."
msgstr "This will permanently delete your two factor authentication method.<0/>Since 2FA is mandatory in your workspace, you will be logged out after deletion and will be asked to configure it again upon login. <1/>Please type in your email to confirm."
+#. js-lingui-id: Dg+3bR
+#. placeholder {0}: pendingChange?.description ?? ''
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+msgid "This will revoke {0} for {userLabel}."
+msgstr "This will revoke {0} for {userLabel}."
+
#. js-lingui-id: f8HOUp
#: src/modules/ai/components/ThinkingStepsDisplay.tsx
msgid "Thought"
@@ -16165,10 +16306,7 @@ msgid "Timeout"
msgstr "Timeout"
#. js-lingui-id: 8TMaZI
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
#: src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobsTable.tsx
msgid "Timestamp"
msgstr "Timestamp"
@@ -16202,6 +16340,7 @@ msgstr "Title"
#: src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionEmailBase.tsx
#: src/modules/workflow/workflow-run/observability/WorkflowRunStepLogsEmailDetail.tsx
#: src/modules/activities/emails/components/EmailComposerFields.tsx
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
msgid "To"
msgstr "To"
@@ -16273,7 +16412,7 @@ msgid "Too many records. Up to {maxRecordsString} allowed"
msgstr "Too many records. Up to {maxRecordsString} allowed"
#. js-lingui-id: tfaidv
-#. placeholder {0}: part.toolName
+#. placeholder {0}: part.toolName ?? ''
#: src/modules/settings/admin-panel/components/SettingsAdminChatThreadMessageList.tsx
msgid "Tool call: {0}"
msgstr "Tool call: {0}"
@@ -16588,6 +16727,7 @@ msgstr "Type anything..."
#. js-lingui-id: LaEX5I
#: src/modules/activities/emails/components/EmailComposerFields.tsx
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
msgid "Type something or press \"/\" to see commands"
msgstr "Type something or press \"/\" to see commands"
@@ -16791,6 +16931,11 @@ msgstr "unordered"
msgid "Unordered list with bullets"
msgstr "Unordered list with bullets"
+#. js-lingui-id: gCBiZC
+#: src/modules/activities/emails/components/CampaignComposerFields.tsx
+msgid "Unsubscribe group"
+msgstr "Unsubscribe group"
+
#. js-lingui-id: wja8aL
#: src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
#: src/pages/settings/admin-panel/SettingsAdminWorkspaceChatThread.tsx
@@ -16822,6 +16967,11 @@ msgstr "Untitled {labelSingular}"
msgid "Untitled field"
msgstr "Untitled field"
+#. js-lingui-id: cChtk1
+#: src/modules/ui/field/display/components/FileChip.tsx
+msgid "Untitled file"
+msgstr "Untitled file"
+
#. js-lingui-id: RBz20h
#: src/modules/side-panel/pages/page-layout/components/SidePanelPageLayoutDashboardWidgetTypeSelect.tsx
msgid "Untitled iFrame"
@@ -16923,7 +17073,9 @@ msgid "Updated (on specific fields)"
msgstr "Updated (on specific fields)"
#. js-lingui-id: kwkhPe
+#: src/pages/settings/email/SettingsWorkspaceEmail.tsx
#: src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelSection.tsx
+#: src/modules/settings/event-logs/components/SettingsLogs.tsx
#: src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx
#: src/modules/settings/billing/components/internal/ResourceCreditPriceSelector.tsx
#: src/modules/ai/components/AIChatNoMoreBillingCreditsBanner.tsx
@@ -16964,22 +17116,35 @@ msgstr "Upgrade Status"
msgid "Upgrade status refreshed"
msgstr "Upgrade status refreshed"
-#. js-lingui-id: pKCx2F
+#. js-lingui-id: doMiaH
+#. placeholder {0}: latestAvailableVersion ?? ''
#: src/pages/settings/applications/tabs/SettingsApplicationDetailAboutTab.tsx
+msgid "Upgrade to {0}"
+msgstr "Upgrade to {0}"
+
+#. js-lingui-id: nCRRVY
+#. placeholder {0}: nextResourceCreditsAmount ?? ''
+#. placeholder {1}: nextResourceCreditPrice ?? ''
+#. placeholder {2}: nextTierInterval ?? ''
+#: src/modules/ai/components/AIChatNoMoreBillingCreditsBanner.tsx
+msgid "Upgrade to {0} credits for ${1}/{2}."
+msgstr "Upgrade to {0} credits for ${1}/{2}."
+
+#. js-lingui-id: pKCx2F
#: src/pages/settings/applications/components/SettingsApplicationVersionContainer.tsx
msgid "Upgrade to {latestAvailableVersion}"
msgstr "Upgrade to {latestAvailableVersion}"
-#. js-lingui-id: Kutw4+
-#: src/modules/ai/components/AIChatNoMoreBillingCreditsBanner.tsx
-msgid "Upgrade to {nextResourceCreditsAmount} credits for ${nextResourceCreditPrice}/{nextTierInterval}."
-msgstr "Upgrade to {nextResourceCreditsAmount} credits for ${nextResourceCreditPrice}/{nextTierInterval}."
-
#. js-lingui-id: ggd+Ee
#: src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelSection.tsx
msgid "Upgrade to access"
msgstr "Upgrade to access"
+#. js-lingui-id: bihQKI
+#: src/modules/settings/event-logs/components/SettingsLogs.tsx
+msgid "Upgrade to access audit logs"
+msgstr "Upgrade to access audit logs"
+
#. js-lingui-id: Wurpq2
#: src/modules/settings/security/components/SettingsSecuritySettings.tsx
msgid "Upgrade to Enterprise to access audit logs."
@@ -17114,7 +17279,7 @@ msgid "Usage by User"
msgstr "Usage by User"
#. js-lingui-id: CedRjP
-#: src/pages/settings/security/event-logs/components/EventLogTableSelector.tsx
+#: src/modules/settings/event-logs/components/EventLogTableSelector.tsx
msgid "Usage Events"
msgstr "Usage Events"
@@ -17169,9 +17334,6 @@ msgid "Useful for pivot/junction tables"
msgstr "Useful for pivot/junction tables"
#. js-lingui-id: 7PzzBU
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
-#: src/pages/settings/security/event-logs/utils/getColumnsForEventLogTable.ts
#: src/pages/settings/profile/SettingsTwoFactorAuthenticationMethod.tsx
#: src/pages/settings/profile/SettingsProfile.tsx
#: src/pages/settings/profile/appearance/components/SettingsExperience.tsx
@@ -17184,6 +17346,7 @@ msgstr "Useful for pivot/junction tables"
#: src/pages/settings/accounts/SettingsAccountsCalendars.tsx
#: src/pages/settings/accounts/SettingsAccounts.tsx
#: src/modules/settings/hooks/useSettingsNavigationItems.tsx
+#: src/modules/settings/event-logs/utils/getColumnsForEventLogTable.tsx
#: src/modules/settings/accounts/components/SettingsAccountsNewImapSmtpCaldavConnection.tsx
#: src/modules/settings/accounts/components/SettingsAccountsEditImapSmtpCaldavConnection.tsx
msgid "User"
@@ -17224,6 +17387,11 @@ msgstr "User Usage"
msgid "Users"
msgstr "Users"
+#. js-lingui-id: zCO0/Y
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
+msgid "Users with server-level access. Open a user to grant or revoke access; use the search below to find anyone."
+msgstr "Users with server-level access. Open a user to grant or revoke access; use the search below to find anyone."
+
#. js-lingui-id: UIOjSC
#: src/modules/settings/admin-panel/signing-keys/components/SettingsAdminSigningKeysTable.tsx
msgid "Uses (last {verifyWindowDays}d)"
@@ -17323,11 +17491,6 @@ msgstr "Verify"
msgid "Verify code from the app"
msgstr "Verify code from the app"
-#. js-lingui-id: hdyekU
-#: src/modules/settings/workspace/components/SettingsWorkspaceEmailingDomainsSection.tsx
-msgid "Verify domains so the workspace can send outbound email through them."
-msgstr "Verify domains so the workspace can send outbound email through them."
-
#. js-lingui-id: zS/rMV
#: src/pages/settings/profile/SettingsTwoFactorAuthenticationMethod.tsx
msgid "Verify the code from the app"
@@ -17387,11 +17550,6 @@ msgstr "View AI usage breakdown"
msgid "View all evaluations"
msgstr "View all evaluations"
-#. js-lingui-id: XVf/G7
-#: src/modules/settings/security/components/SettingsSecuritySettings.tsx
-msgid "View and filter events, page views, object changes"
-msgstr "View and filter events, page views, object changes"
-
#. js-lingui-id: KANz0G
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
@@ -17449,11 +17607,6 @@ msgstr "View invoices"
msgid "View Jobs"
msgstr "View Jobs"
-#. js-lingui-id: 923YyC
-#: src/modules/settings/security/components/SettingsSecuritySettings.tsx
-msgid "View Logs"
-msgstr "View Logs"
-
#. js-lingui-id: sAPirx
#: src/modules/object-record/record-index/components/RecordIndexEmptyStateNotShared.tsx
msgid "View not shared"
@@ -17489,11 +17642,6 @@ msgstr "View type"
msgid "View usage"
msgstr "View usage"
-#. js-lingui-id: rWiqJF
-#: src/modules/settings/security/components/SettingsSecuritySettings.tsx
-msgid "View workspace activity logs"
-msgstr "View workspace activity logs"
-
#. js-lingui-id: 1I6UoR
#: src/pages/settings/layout/SettingsLayoutViewDetail.tsx
#: src/pages/settings/layout/SettingsLayout.tsx
@@ -17635,10 +17783,11 @@ msgstr "Watch members demo"
msgid "We encountered an issue verifying"
msgstr "We encountered an issue verifying"
-#. js-lingui-id: 6d9mjh
+#. js-lingui-id: 4x3zRh
+#. placeholder {0}: objectLabelSingular ?? ''
#: src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionUpsertRecord.tsx
-msgid "We match on these fields. If a {objectLabelSingular} already exists, we update it. Otherwise, we create a new one."
-msgstr "We match on these fields. If a {objectLabelSingular} already exists, we update it. Otherwise, we create a new one."
+msgid "We match on these fields. If a {0} already exists, we update it. Otherwise, we create a new one."
+msgstr "We match on these fields. If a {0} already exists, we update it. Otherwise, we create a new one."
#. js-lingui-id: id6ein
#: src/modules/ui/input/components/ImageInput.tsx
@@ -17901,7 +18050,6 @@ msgstr "Workflows"
#. js-lingui-id: pmUArF
#: src/pages/settings/security/SettingsSecuritySSOIdentifyProvider.tsx
#: src/pages/settings/security/SettingsSecurityApprovedAccessDomain.tsx
-#: src/pages/settings/security/event-logs/SettingsEventLogs.tsx
#: src/pages/settings/members/SettingsWorkspaceMembers.tsx
#: src/pages/settings/members/SettingsWorkspaceMember.tsx
#: src/pages/settings/members/roles/SettingsRoleAddObjectLevel.tsx
@@ -17912,8 +18060,6 @@ msgstr "Workflows"
#: src/pages/settings/layout/components/SettingsLayoutDetailScaffold.tsx
#: src/pages/settings/general/SettingsGeneral.tsx
#: src/pages/settings/enterprise/SettingsEnterprise.tsx
-#: src/pages/settings/emailing-domains/SettingsNewEmailingDomain.tsx
-#: src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
#: src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
#: src/pages/settings/email/SettingsWorkspaceEmail.tsx
#: src/pages/settings/developers/webhooks/components/SettingsWebhooks.tsx
@@ -17993,8 +18139,7 @@ msgid "Workspace Domain"
msgstr "Workspace Domain"
#. js-lingui-id: J2q6WC
-#: src/pages/settings/security/event-logs/components/EventLogTableSelector.tsx
-#: src/modules/settings/security/components/SettingsSecuritySettings.tsx
+#: src/modules/settings/event-logs/components/EventLogTableSelector.tsx
msgid "Workspace Events"
msgstr "Workspace Events"
@@ -18019,13 +18164,9 @@ msgstr "Workspace lists by upgrade status"
msgid "Workspace logo"
msgstr "Workspace logo"
-#. js-lingui-id: qc38qR
-#: src/pages/settings/security/event-logs/components/EventLogFilters.tsx
-msgid "Workspace Member"
-msgstr "Workspace Member"
-
#. js-lingui-id: wtxjAY
#: src/pages/settings/admin-panel/SettingsAdminWorkspaceDetail.tsx
+#: src/modules/settings/event-logs/components/EventLogFilters.tsx
msgid "Workspace members"
msgstr "Workspace members"
@@ -18163,6 +18304,8 @@ msgstr "yes"
#: src/pages/settings/applications/components/SettingsApplicationRegistrationGeneralInfo.tsx
#: src/pages/settings/ai/components/SettingsToolParameterTable.tsx
#: src/modules/settings/admin-panel/components/SettingsAdminWorkspaceBillingContent.tsx
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
+#: src/modules/settings/admin-panel/components/SettingsAdminServerAdmins.tsx
#: src/modules/settings/admin-panel/apps/components/SettingsAdminApps.tsx
#: src/modules/settings/admin-panel/apps/components/SettingsAdminApps.tsx
msgid "Yes"
@@ -18269,14 +18412,17 @@ msgstr ""
"You've hit your usage limit. \n"
"Reach to our support team to upgrade."
-#. js-lingui-id: /fksQo
+#. js-lingui-id: NTyvVW
+#. placeholder {0}: nextResourceCreditsAmount ?? ''
+#. placeholder {1}: nextResourceCreditPrice ?? ''
+#. placeholder {2}: nextTierInterval ?? ''
#: src/modules/ai/components/AIChatNoMoreBillingCreditsBanner.tsx
msgid ""
"You've hit your usage limit. \n"
-"Upgrade to {nextResourceCreditsAmount} credits for ${nextResourceCreditPrice}/{nextTierInterval}."
+"Upgrade to {0} credits for ${1}/{2}."
msgstr ""
"You've hit your usage limit. \n"
-"Upgrade to {nextResourceCreditsAmount} credits for ${nextResourceCreditPrice}/{nextTierInterval}."
+"Upgrade to {0} credits for ${1}/{2}."
#. js-lingui-id: yZ0wRS
#: src/modules/ai/components/AIChatNoMoreBillingCreditsBanner.tsx
diff --git a/packages/twenty-front/src/modules/activities/emails/components/CampaignComposerFields.tsx b/packages/twenty-front/src/modules/activities/emails/components/CampaignComposerFields.tsx
new file mode 100644
index 00000000000..547abb198fd
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/emails/components/CampaignComposerFields.tsx
@@ -0,0 +1,152 @@
+import { styled } from '@linaria/react';
+
+import { useCampaignAudiencePreview } from '@/activities/emails/hooks/useCampaignAudiencePreview';
+import { type useCampaignComposerState } from '@/activities/emails/hooks/useCampaignComposerState';
+import { useUnsubscribeTopics } from '@/activities/emails/hooks/useUnsubscribeTopics';
+import { useCreateOneRecord } from '@/object-record/hooks/useCreateOneRecord';
+import { FormAdvancedTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormAdvancedTextFieldInput';
+import { FormSingleRecordPicker } from '@/object-record/record-field/ui/form-types/components/FormSingleRecordPicker';
+import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput';
+import { useMyMessageChannels } from '@/settings/accounts/hooks/useMyMessageChannels';
+import { Select } from '@/ui/input/components/Select';
+import { t } from '@lingui/core/macro';
+import { MessageChannelType } from 'twenty-shared/types';
+import { isDefined } from 'twenty-shared/utils';
+import { type SelectOption } from 'twenty-ui-deprecated/input';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+
+const StyledFieldsContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+ gap: ${themeCssVariables.spacing[1]};
+ padding: ${themeCssVariables.spacing[3]} ${themeCssVariables.spacing[2]};
+`;
+
+const StyledHint = styled.div`
+ color: ${themeCssVariables.font.color.tertiary};
+ font-size: ${themeCssVariables.font.size.xs};
+ padding: ${themeCssVariables.spacing[1]} 0;
+`;
+
+type CampaignAudiencePreview = NonNullable<
+ ReturnType<typeof useCampaignAudiencePreview>
+>;
+
+const buildAudienceHint = (preview: CampaignAudiencePreview): string => {
+ const parts: string[] = [];
+
+ if (preview.withoutEmail > 0) {
+ parts.push(t`${preview.withoutEmail} without email`);
+ }
+ if (preview.duplicateEmails > 0) {
+ parts.push(t`${preview.duplicateEmails} duplicate`);
+ }
+ if (preview.globallyUnsubscribed > 0) {
+ parts.push(t`${preview.globallyUnsubscribed} unsubscribed from everything`);
+ }
+ if (preview.topicUnsubscribed > 0) {
+ parts.push(t`${preview.topicUnsubscribed} opted out of this topic`);
+ }
+
+ const breakdown = parts.length > 0 ? ` (${parts.join(', ')})` : '';
+
+ return (
+ t`${preview.totalMembers} in this list — ${preview.sendable} sendable` +
+ breakdown
+ );
+};
+
+type CampaignComposerFieldsProps = {
+ campaignState: ReturnType<typeof useCampaignComposerState>;
+};
+
+export const CampaignComposerFields = ({
+ campaignState,
+}: CampaignComposerFieldsProps) => {
+ const { channels } = useMyMessageChannels();
+ const { unsubscribeTopics } = useUnsubscribeTopics();
+ const { createOneRecord: createMessageList } = useCreateOneRecord({
+ objectNameSingular: 'messageList',
+ });
+
+ const handleCreateList = async (searchInput?: string) => {
+ const listName = searchInput?.trim() ?? '';
+ const createdList = await createMessageList({
+ name: listName.length > 0 ? listName : t`Untitled list`,
+ });
+
+ if (isDefined(createdList)) {
+ campaignState.setListId(createdList.id);
+ }
+ };
+
+ const audiencePreview = useCampaignAudiencePreview({
+ listId: campaignState.listId,
+ unsubscribeTopicId: campaignState.unsubscribeTopicId,
+ });
+
+ const senderOptions: SelectOption<string>[] = channels
+ .filter((channel) => channel.type === MessageChannelType.EMAIL_GROUP)
+ .map((channel) => channel.connectedAccount?.handle)
+ .filter(isDefined)
+ .map((handle) => ({ label: handle, value: handle }));
+
+ const topicOptions: SelectOption<string>[] = unsubscribeTopics.map(
+ (topic) => ({
+ label: topic.name ?? t`Untitled topic`,
+ value: topic.id,
+ }),
+ );
+
+ return (
+ <StyledFieldsContainer>
+ <Select
+ dropdownId="campaign-composer-from-account"
+ label={t`From`}
+ fullWidth
+ value={campaignState.fromAddress}
+ options={senderOptions}
+ emptyOption={{ label: t`Select a sender`, value: '' }}
+ onChange={campaignState.setFromAddress}
+ />
+ <FormSingleRecordPicker
+ label={t`To`}
+ objectNameSingulars={['messageList']}
+ defaultValue={campaignState.listId}
+ onChange={campaignState.setListId}
+ onCreate={handleCreateList}
+ />
+ {isDefined(audiencePreview) && (
+ <StyledHint>{buildAudienceHint(audiencePreview)}</StyledHint>
+ )}
+ <Select
+ dropdownId="campaign-composer-unsubscribe-topic"
+ label={t`Unsubscribe topic`}
+ fullWidth
+ value={campaignState.unsubscribeTopicId ?? ''}
+ options={topicOptions}
+ emptyOption={{ label: t`No topic`, value: '' }}
+ onChange={(value) =>
+ campaignState.setUnsubscribeTopicId(value === '' ? null : value)
+ }
+ />
+ <StyledHint>
+ {t`The unsubscribe topic this email belongs to. Recipients who opted out of it are skipped, and the unsubscribe link is scoped to it.`}
+ </StyledHint>
+ <FormTextFieldInput
+ label={t`Subject`}
+ defaultValue={campaignState.subject}
+ onChange={campaignState.setSubject}
+ placeholder={t`Subject`}
+ />
+ <FormAdvancedTextFieldInput
+ defaultValue=""
+ onChange={campaignState.setBody}
+ placeholder={t`Type something or press "/" to see commands`}
+ minHeight={120}
+ maxWidth={600}
+ contentType="html"
+ />
+ </StyledFieldsContainer>
+ );
+};
diff --git a/packages/twenty-front/src/modules/activities/emails/components/EmailComposer.tsx b/packages/twenty-front/src/modules/activities/emails/components/EmailComposer.tsx
deleted file mode 100644
index 938f1ea8814..00000000000
--- a/packages/twenty-front/src/modules/activities/emails/components/EmailComposer.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-import { styled } from '@linaria/react';
-
-import { EmailComposerFields } from '@/activities/emails/components/EmailComposerFields';
-import { useEmailComposerState } from '@/activities/emails/hooks/useEmailComposerState';
-import { t } from '@lingui/core/macro';
-import { IconArrowBackUp } from 'twenty-ui-deprecated/display';
-import { Button } from 'twenty-ui-deprecated/input';
-import { themeCssVariables } from 'twenty-ui-deprecated/theme-constants';
-
-const StyledFooterWarning = styled.span`
- color: ${themeCssVariables.color.red};
- flex: 1;
- font-size: ${themeCssVariables.font.size.xs};
-`;
-
-const StyledComposerContainer = styled.div`
- background: ${themeCssVariables.background.primary};
- display: flex;
- flex-direction: column;
-`;
-
-const StyledFooter = styled.div`
- align-items: center;
- border-top: 1px solid ${themeCssVariables.border.color.light};
- display: flex;
- justify-content: flex-end;
- padding: ${themeCssVariables.spacing[2]} ${themeCssVariables.spacing[4]};
-`;
-
-const StyledFooterActions = styled.div`
- align-items: center;
- display: flex;
- gap: ${themeCssVariables.spacing[2]};
-`;
-
-type EmailComposerProps = {
- connectedAccountId: string;
- defaultTo?: string;
- defaultSubject?: string;
- defaultInReplyTo?: string;
- onClose?: () => void;
- onSent?: () => void;
-};
-
-export const EmailComposer = ({
- connectedAccountId,
- defaultTo = '',
- defaultSubject = '',
- defaultInReplyTo,
- onClose,
- onSent,
-}: EmailComposerProps) => {
- const composerState = useEmailComposerState({
- connectedAccountId,
- defaultTo,
- defaultSubject,
- defaultInReplyTo,
- onSent,
- });
-
- return (
- <StyledComposerContainer>
- <EmailComposerFields composerState={composerState} />
- <StyledFooter>
- {composerState.exceedsRecipientLimit && (
- <StyledFooterWarning>
- {t`Too many recipients (${composerState.recipientCount}/${composerState.maxRecipients}).`}
- </StyledFooterWarning>
- )}
- <StyledFooterActions>
- {onClose && (
- <Button
- size="small"
- variant="secondary"
- title={t`Cancel`}
- onClick={onClose}
- />
- )}
- <Button
- size="small"
- variant="primary"
- accent="blue"
- title={t`Send`}
- Icon={IconArrowBackUp}
- onClick={composerState.handleSend}
- disabled={!composerState.canSend}
- />
- </StyledFooterActions>
- </StyledFooter>
- </StyledComposerContainer>
- );
-};
diff --git a/packages/twenty-front/src/modules/activities/emails/components/MessageThreadSubscriberDropdownAddSubscriber.tsx b/packages/twenty-front/src/modules/activities/emails/components/MessageThreadSubscriberDropdownAddSubscriber.tsx
deleted file mode 100644
index b99ce9651b5..00000000000
--- a/packages/twenty-front/src/modules/activities/emails/components/MessageThreadSubscriberDropdownAddSubscriber.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { MessageThreadSubscriberDropdownAddSubscriberMenuItem } from '@/activities/emails/components/MessageThreadSubscriberDropdownAddSubscriberMenuItem';
-import { type MessageThreadSubscriber } from '@/activities/emails/types/MessageThreadSubscriber';
-import { CoreObjectNameSingular } from 'twenty-shared/types';
-import { useFindManyRecords } from '@/object-record/hooks/useFindManyRecords';
-import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
-import { DropdownMenuSearchInput } from '@/ui/layout/dropdown/components/DropdownMenuSearchInput';
-import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
-import { type WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
-
-export const MessageThreadSubscriberDropdownAddSubscriber = ({
- existingSubscribers,
-}: {
- existingSubscribers: MessageThreadSubscriber[];
-}) => {
- const { records: workspaceMembersLeftToAdd } =
- useFindManyRecords<WorkspaceMember>({
- objectNameSingular: CoreObjectNameSingular.WorkspaceMember,
- filter: {
- not: {
- id: {
- in: existingSubscribers.map(
- ({ workspaceMember }) => workspaceMember.id,
- ),
- },
- },
- },
- });
-
- return (
- <DropdownMenuItemsContainer>
- <DropdownMenuSearchInput />
- <DropdownMenuSeparator />
- {workspaceMembersLeftToAdd.map((workspaceMember) => (
- <MessageThreadSubscriberDropdownAddSubscriberMenuItem
- workspaceMember={workspaceMember}
- />
- ))}
- </DropdownMenuItemsContainer>
- );
-};
diff --git a/packages/twenty-front/src/modules/activities/emails/components/MessageThreadSubscriberDropdownAddSubscriberMenuItem.tsx b/packages/twenty-front/src/modules/activities/emails/components/MessageThreadSubscriberDropdownAddSubscriberMenuItem.tsx
deleted file mode 100644
index e061b0cf1af..00000000000
--- a/packages/twenty-front/src/modules/activities/emails/components/MessageThreadSubscriberDropdownAddSubscriberMenuItem.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { type MessageThreadSubscriber } from '@/activities/emails/types/MessageThreadSubscriber';
-import { CoreObjectNameSingular } from 'twenty-shared/types';
-import { useCreateOneRecord } from '@/object-record/hooks/useCreateOneRecord';
-import { type WorkspaceMember } from '@/workspace-member/types/WorkspaceMember';
-import { IconPlus } from 'twenty-ui-deprecated/display';
-import { MenuItemAvatar } from 'twenty-ui-deprecated/navigation';
-
-export const MessageThreadSubscriberDropdownAddSubscriberMenuItem = ({
- workspaceMember,
-}: {
- workspaceMember: WorkspaceMember;
-}) => {
- const text = `${workspaceMember.name.firstName} ${workspaceMember.name.lastName}`;
-
- const { createOneRecord } = useCreateOneRecord<MessageThreadSubscriber>({
- objectNameSingular: CoreObjectNameSingular.MessageThreadSubscriber,
- });
-
- const handleAddButtonClick = () => {
- createOneRecord({
- workspaceMember,
- });
- };
-
- return (
- <MenuItemAvatar
- avatar={{
- placeholder: workspaceMember.name.firstName,
- avatarUrl: workspaceMember.avatarUrl,
- placeholderColorSeed: workspaceMember.id,
- size: 'md',
- type: 'rounded',
- }}
- text={text}
- iconButtons={[
- {
- Icon: IconPlus,
- onClick: handleAddButtonClick,
- },
- ]}
- />
- );
-};
diff --git a/packages/twenty-front/src/modules/activities/emails/graphql/metadata-queries/previewMessageCampaignAudience.ts b/packages/twenty-front/src/modules/activities/emails/graphql/metadata-queries/previewMessageCampaignAudience.ts
new file mode 100644
index 00000000000..904f31d70cd
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/emails/graphql/metadata-queries/previewMessageCampaignAudience.ts
@@ -0,0 +1,16 @@
+import gql from 'graphql-tag';
+
+export const PREVIEW_MESSAGE_CAMPAIGN_AUDIENCE = gql`
+ query PreviewMessageCampaignAudience(
+ $input: PreviewMessageCampaignAudienceInput!
+ ) {
+ previewMessageCampaignAudience(input: $input) {
+ totalMembers
+ withoutEmail
+ duplicateEmails
+ globallyUnsubscribed
+ topicUnsubscribed
+ sendable
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/activities/emails/graphql/metadata-queries/unsubscribeTopics.ts b/packages/twenty-front/src/modules/activities/emails/graphql/metadata-queries/unsubscribeTopics.ts
new file mode 100644
index 00000000000..e626c2ea1ef
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/emails/graphql/metadata-queries/unsubscribeTopics.ts
@@ -0,0 +1,12 @@
+import { gql } from '@apollo/client';
+
+export const UNSUBSCRIBE_TOPICS = gql`
+ query UnsubscribeTopics {
+ unsubscribeTopics {
+ id
+ name
+ description
+ visibility
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/activities/emails/graphql/mutations/sendMessageCampaign.ts b/packages/twenty-front/src/modules/activities/emails/graphql/mutations/sendMessageCampaign.ts
new file mode 100644
index 00000000000..e924cbfb024
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/emails/graphql/mutations/sendMessageCampaign.ts
@@ -0,0 +1,15 @@
+import gql from 'graphql-tag';
+
+export const SEND_MESSAGE_CAMPAIGN = gql`
+ mutation SendMessageCampaign($input: SendMessageCampaignInput!) {
+ sendMessageCampaign(input: $input) {
+ campaignId
+ queuedCount
+ skipped {
+ noEmail
+ deduped
+ overCap
+ }
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/__tests__/useCampaignComposerState.test.ts b/packages/twenty-front/src/modules/activities/emails/hooks/__tests__/useCampaignComposerState.test.ts
new file mode 100644
index 00000000000..aeed1b5929e
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/__tests__/useCampaignComposerState.test.ts
@@ -0,0 +1,129 @@
+import { act, renderHook } from '@testing-library/react';
+
+import { useCampaignComposerState } from '@/activities/emails/hooks/useCampaignComposerState';
+import { useSendMessageCampaign } from '@/activities/emails/hooks/useSendMessageCampaign';
+
+jest.mock('@/activities/emails/hooks/useSendMessageCampaign');
+
+const sendMessageCampaignMock = jest.fn(
+ (): Promise<boolean> => Promise.resolve(true),
+);
+
+const mockedUseSendMessageCampaign = jest.mocked(useSendMessageCampaign);
+
+const fillSendableFields = (result: {
+ current: ReturnType<typeof useCampaignComposerState>;
+}) => {
+ act(() => {
+ result.current.setListId('list-1');
+ result.current.setFromAddress(' [email protected] ');
+ result.current.setSubject('Hello');
+ });
+};
+
+describe('useCampaignComposerState', () => {
+ beforeEach(() => {
+ jest.clearAllMocks();
+ mockedUseSendMessageCampaign.mockReturnValue({
+ sendMessageCampaign: sendMessageCampaignMock,
+ loading: false,
+ });
+ });
+
+ it('should start empty and not be sendable', () => {
+ const { result } = renderHook(() => useCampaignComposerState({}));
+
+ expect(result.current.listId).toBeNull();
+ expect(result.current.unsubscribeTopicId).toBeNull();
+ expect(result.current.canSend).toBe(false);
+ });
+
+ it('should become sendable once list, from address and subject are set', () => {
+ const { result } = renderHook(() => useCampaignComposerState({}));
+
+ fillSendableFields(result);
+
+ expect(result.current.canSend).toBe(true);
+ });
+
+ it('should not be sendable while a send is in flight', () => {
+ mockedUseSendMessageCampaign.mockReturnValue({
+ sendMessageCampaign: sendMessageCampaignMock,
+ loading: true,
+ });
+
+ const { result } = renderHook(() => useCampaignComposerState({}));
+
+ fillSendableFields(result);
+
+ expect(result.current.canSend).toBe(false);
+ });
+
+ it('should send trimmed values with the selected topic and call onSent on success', async () => {
+ sendMessageCampaignMock.mockResolvedValue(true);
+ const onSent = jest.fn();
+
+ const { result } = renderHook(() => useCampaignComposerState({ onSent }));
+
+ act(() => {
+ result.current.setUnsubscribeTopicId('topic-1');
+ result.current.setBody('Body');
+ });
+ fillSendableFields(result);
+
+ await act(async () => {
+ await result.current.handleSend();
+ });
+
+ expect(sendMessageCampaignMock).toHaveBeenCalledWith({
+ listId: 'list-1',
+ unsubscribeTopicId: 'topic-1',
+ subject: 'Hello',
+ body: 'Body',
+ fromAddress: '[email protected]',
+ });
+ expect(onSent).toHaveBeenCalledTimes(1);
+ });
+
+ it('should pass an undefined topic when none is selected', async () => {
+ sendMessageCampaignMock.mockResolvedValue(true);
+
+ const { result } = renderHook(() => useCampaignComposerState({}));
+
+ fillSendableFields(result);
+
+ await act(async () => {
+ await result.current.handleSend();
+ });
+
+ expect(sendMessageCampaignMock).toHaveBeenCalledWith(
+ expect.objectContaining({ unsubscribeTopicId: undefined }),
+ );
+ });
+
+ it('should not send when required fields are missing', async () => {
+ const { result } = renderHook(() => useCampaignComposerState({}));
+
+ await act(async () => {
+ await result.current.handleSend();
+ });
+
+ expect(sendMessageCampaignMock).not.toHaveBeenCalled();
+ });
+
+ it('should not call onSent when the send fails', async () => {
+ sendMessageCampaignMock.mockResolvedValue(false);
+ const onSent = jest.fn();
+
+ const { result } = renderHook(() => useCampaignComposerState({ onSent }));
+
+ fillSendableFields(result);
+
+ await act(async () => {
+ await result.current.handleSend();
+ });
+
+ expect(sendMessageCampaignMock).toHaveBeenCalled();
+ expect(onSent).not.toHaveBeenCalled();
+ });
+});
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useCampaignAudiencePreview.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useCampaignAudiencePreview.ts
new file mode 100644
index 00000000000..0b01d9d1140
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useCampaignAudiencePreview.ts
@@ -0,0 +1,35 @@
+import { useQuery } from '@apollo/client/react';
+
+import { isNonEmptyString } from '@sniptt/guards';
+
+import { PREVIEW_MESSAGE_CAMPAIGN_AUDIENCE } from '@/activities/emails/graphql/metadata-queries/previewMessageCampaignAudience';
+import {
+ type PreviewMessageCampaignAudienceQuery,
+ type PreviewMessageCampaignAudienceQueryVariables,
+} from '~/generated-metadata/graphql';
+
+type UseCampaignAudiencePreviewArgs = {
+ listId: string | null;
+ unsubscribeTopicId: string | null;
+};
+
+export const useCampaignAudiencePreview = ({
+ listId,
+ unsubscribeTopicId,
+}: UseCampaignAudiencePreviewArgs) => {
+ const { data } = useQuery<
+ PreviewMessageCampaignAudienceQuery,
+ PreviewMessageCampaignAudienceQueryVariables
+ >(PREVIEW_MESSAGE_CAMPAIGN_AUDIENCE, {
+ skip: !isNonEmptyString(listId),
+ variables: {
+ input: {
+ listId: listId ?? '',
+ unsubscribeTopicId: unsubscribeTopicId ?? undefined,
+ },
+ },
+ fetchPolicy: 'cache-and-network',
+ });
+
+ return data?.previewMessageCampaignAudience ?? null;
+};
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useCampaignComposerState.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useCampaignComposerState.ts
new file mode 100644
index 00000000000..8cf24046d8d
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useCampaignComposerState.ts
@@ -0,0 +1,61 @@
+import { useState } from 'react';
+
+import { useSendMessageCampaign } from '@/activities/emails/hooks/useSendMessageCampaign';
+
+type UseCampaignComposerStateArgs = {
+ onSent?: () => void;
+};
+
+export const useCampaignComposerState = ({
+ onSent,
+}: UseCampaignComposerStateArgs) => {
+ const [unsubscribeTopicId, setUnsubscribeTopicId] = useState<string | null>(
+ null,
+ );
+ const [listId, setListId] = useState<string | null>(null);
+ const [fromAddress, setFromAddress] = useState('');
+ const [subject, setSubject] = useState('');
+ const [body, setBody] = useState('');
+
+ const { sendMessageCampaign, loading } = useSendMessageCampaign();
+
+ const canSend =
+ listId !== null &&
+ fromAddress.trim().length > 0 &&
+ subject.trim().length > 0 &&
+ !loading;
+
+ const handleSend = async () => {
+ if (listId === null || !canSend) {
+ return;
+ }
+
+ const success = await sendMessageCampaign({
+ listId,
+ unsubscribeTopicId: unsubscribeTopicId ?? undefined,
+ subject,
+ body,
+ fromAddress: fromAddress.trim(),
+ });
+
+ if (success) {
+ onSent?.();
+ }
+ };
+
+ return {
+ unsubscribeTopicId,
+ setUnsubscribeTopicId,
+ listId,
+ setListId,
+ fromAddress,
+ setFromAddress,
+ subject,
+ setSubject,
+ body,
+ setBody,
+ handleSend,
+ canSend,
+ loading,
+ };
+};
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts
new file mode 100644
index 00000000000..094e8f73a00
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useSendMessageCampaign.ts
@@ -0,0 +1,76 @@
+import { useMutation } from '@apollo/client/react';
+import { useCallback } from 'react';
+
+import { SEND_MESSAGE_CAMPAIGN } from '@/activities/emails/graphql/mutations/sendMessageCampaign';
+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { t } from '@lingui/core/macro';
+import {
+ type SendMessageCampaignMutation,
+ type SendMessageCampaignMutationVariables,
+} from '~/generated-metadata/graphql';
+
+type SendMessageCampaignParams = {
+ listId: string;
+ unsubscribeTopicId?: string;
+ subject: string;
+ body: string;
+ fromAddress: string;
+};
+
+export const useSendMessageCampaign = () => {
+ const [sendMessageCampaignMutation, { loading }] = useMutation<
+ SendMessageCampaignMutation,
+ SendMessageCampaignMutationVariables
+ >(SEND_MESSAGE_CAMPAIGN);
+
+ const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();
+
+ const sendMessageCampaign = useCallback(
+ async (params: SendMessageCampaignParams): Promise<boolean> => {
+ try {
+ const result = await sendMessageCampaignMutation({
+ variables: { input: params },
+ });
+
+ const queued = result.data?.sendMessageCampaign;
+
+ if (!queued) {
+ enqueueErrorSnackBar({ message: t`Failed to send campaign` });
+
+ return false;
+ }
+
+ const { queuedCount, skipped } = queued;
+ const skippedCount =
+ skipped.noEmail + skipped.deduped + skipped.overCap;
+
+ if (queuedCount === 0) {
+ enqueueErrorSnackBar({
+ message: t`No recipients to send to (${skippedCount} skipped)`,
+ });
+
+ return false;
+ }
+
+ enqueueSuccessSnackBar({
+ message:
+ skippedCount > 0
+ ? t`Campaign queued to ${queuedCount} recipient(s), ${skippedCount} skipped`
+ : t`Campaign queued to ${queuedCount} recipient(s)`,
+ });
+
+ return true;
+ } catch (error) {
+ enqueueErrorSnackBar({
+ message:
+ error instanceof Error ? error.message : t`Failed to send campaign`,
+ });
+
+ return false;
+ }
+ },
+ [sendMessageCampaignMutation, enqueueSuccessSnackBar, enqueueErrorSnackBar],
+ );
+
+ return { sendMessageCampaign, loading };
+};
diff --git a/packages/twenty-front/src/modules/activities/emails/hooks/useUnsubscribeTopics.ts b/packages/twenty-front/src/modules/activities/emails/hooks/useUnsubscribeTopics.ts
new file mode 100644
index 00000000000..51ed5e0b21b
--- /dev/null
+++ b/packages/twenty-front/src/modules/activities/emails/hooks/useUnsubscribeTopics.ts
@@ -0,0 +1,9 @@
+import { useQuery } from '@apollo/client/react';
+
+import { UnsubscribeTopicsDocument } from '~/generated-metadata/graphql';
+
+export const useUnsubscribeTopics = () => {
+ const { data, loading } = useQuery(UnsubscribeTopicsDocument);
+
+ return { unsubscribeTopics: data?.unsubscribeTopics ?? [], loading };
+};
diff --git a/packages/twenty-front/src/modules/activities/emails/states/lastViewableEmailThreadIdState.ts b/packages/twenty-front/src/modules/activities/emails/states/lastViewableEmailThreadIdState.ts
deleted file mode 100644
index 36914413256..00000000000
--- a/packages/twenty-front/src/modules/activities/emails/states/lastViewableEmailThreadIdState.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
-export const emailThreadIdWhenEmailThreadWasClosedState = createAtomState<
- string | null
->({
- key: 'emailThreadIdWhenEmailThreadWasClosedState',
- defaultValue: null,
-});
diff --git a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
index 2711915dd3d..014b6fd0fb4 100644
--- a/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
+++ b/packages/twenty-front/src/modules/app/components/SettingsRoutes.tsx
@@ -128,6 +128,22 @@ const SettingsWorkspaceEmailGroupChannelDetail = lazy(() =>
),
);
+const SettingsWorkspaceNewUnsubscribeTopic = lazy(() =>
+ import('~/pages/settings/email/SettingsWorkspaceNewUnsubscribeTopic').then(
+ (module) => ({
+ default: module.SettingsWorkspaceNewUnsubscribeTopic,
+ }),
+ ),
+);
+
+const SettingsWorkspaceUnsubscribeTopicDetail = lazy(() =>
+ import('~/pages/settings/email/SettingsWorkspaceUnsubscribeTopicDetail').then(
+ (module) => ({
+ default: module.SettingsWorkspaceUnsubscribeTopicDetail,
+ }),
+ ),
+);
+
const SettingsSubdomainPage = lazy(() =>
import('~/pages/settings/domains/SettingsSubdomainPage').then((module) => ({
default: module.SettingsSubdomainPage,
@@ -435,22 +451,6 @@ const SettingsSecurityApprovedAccessDomain = lazy(() =>
),
);
-const SettingsNewEmailingDomain = lazy(() =>
- import('~/pages/settings/emailing-domains/SettingsNewEmailingDomain').then(
- (module) => ({
- default: module.SettingsNewEmailingDomain,
- }),
- ),
-);
-
-const SettingsEmailingDomainDetail = lazy(() =>
- import('~/pages/settings/emailing-domains/SettingsEmailingDomainDetail').then(
- (module) => ({
- default: module.SettingsEmailingDomainDetail,
- }),
- ),
-);
-
const SettingsAdmin = lazy(() =>
import('~/pages/settings/admin-panel/SettingsAdmin').then((module) => ({
default: module.SettingsAdmin,
@@ -656,6 +656,14 @@ export const SettingsRoutes = ({ isAdminPageEnabled }: SettingsRoutesProps) => (
path={SettingsPath.EmailGroupChannelDetail}
element={<SettingsWorkspaceEmailGroupChannelDetail />}
/>
+ <Route
+ path={SettingsPath.NewUnsubscribeTopic}
+ element={<SettingsWorkspaceNewUnsubscribeTopic />}
+ />
+ <Route
+ path={SettingsPath.UnsubscribeTopicDetail}
+ element={<SettingsWorkspaceUnsubscribeTopicDetail />}
+ />
<Route path={SettingsPath.Billing} element={<SettingsBilling />} />
<Route path={SettingsPath.Usage} element={<SettingsUsage />} />
<Route
@@ -670,14 +678,6 @@ export const SettingsRoutes = ({ isAdminPageEnabled }: SettingsRoutesProps) => (
path={SettingsPath.CustomDomain}
element={<SettingsCustomDomainPage />}
/>
- <Route
- path={SettingsPath.NewEmailingDomain}
- element={<SettingsNewEmailingDomain />}
- />
- <Route
- path={SettingsPath.EmailingDomainDetail}
- element={<SettingsEmailingDomainDetail />}
- />
<Route
path={SettingsPath.PublicDomain}
element={<SettingPublicDomain />}
diff --git a/packages/twenty-front/src/modules/client-config/hooks/useClientConfig.ts b/packages/twenty-front/src/modules/client-config/hooks/useClientConfig.ts
index 2913cae64d7..04644f87df6 100644
--- a/packages/twenty-front/src/modules/client-config/hooks/useClientConfig.ts
+++ b/packages/twenty-front/src/modules/client-config/hooks/useClientConfig.ts
@@ -13,8 +13,7 @@ import { isDeveloperDefaultSignInPrefilledState } from '@/client-config/states/i
import { isClickHouseConfiguredState } from '@/client-config/states/isClickHouseConfiguredState';
import { isCloudflareIntegrationEnabledState } from '@/client-config/states/isCloudflareIntegrationEnabledState';
import { isDDLLockedState } from '@/client-config/states/isDDLLockedState';
-import { isEmailGroupEnabledState } from '@/client-config/states/isEmailGroupEnabledState';
-import { isEmailingDomainsEnabledState } from '@/client-config/states/isEmailingDomainsEnabledState';
+import { isEmailingDomainInDemoModeState } from '@/client-config/states/isEmailingDomainInDemoModeState';
import { isEmailVerificationRequiredState } from '@/client-config/states/isEmailVerificationRequiredState';
import { isGoogleCalendarEnabledState } from '@/client-config/states/isGoogleCalendarEnabledState';
import { isGoogleMessagingEnabledState } from '@/client-config/states/isGoogleMessagingEnabledState';
@@ -101,10 +100,8 @@ export const useClientConfig = (): UseClientConfigResult => {
const setCalendarBookingPageId = useSetAtomState(calendarBookingPageIdState);
- const setIsEmailGroupEnabled = useSetAtomState(isEmailGroupEnabledState);
-
- const setIsEmailingDomainsEnabled = useSetAtomState(
- isEmailingDomainsEnabledState,
+ const setIsEmailingDomainInDemoMode = useSetAtomState(
+ isEmailingDomainInDemoModeState,
);
const setIsImapSmtpCaldavEnabled = useSetAtomState(
@@ -199,8 +196,9 @@ export const useClientConfig = (): UseClientConfigResult => {
setCalendarBookingPageId(clientConfig?.calendarBookingPageId ?? null);
setIsImapSmtpCaldavEnabled(clientConfig?.isImapSmtpCaldavEnabled);
- setIsEmailGroupEnabled(clientConfig?.isEmailGroupEnabled ?? false);
- setIsEmailingDomainsEnabled(clientConfig?.isEmailingDomainsEnabled);
+ setIsEmailingDomainInDemoMode(
+ clientConfig?.isEmailingDomainInDemoMode ?? false,
+ );
setAllowRequestsToTwentyIcons(clientConfig?.allowRequestsToTwentyIcons);
setIsCloudflareIntegrationEnabled(
clientConfig?.isCloudflareIntegrationEnabled,
@@ -238,9 +236,8 @@ export const useClientConfig = (): UseClientConfigResult => {
setIsDeveloperDefaultSignInPrefilled,
setIsEmailVerificationRequired,
setIsImapSmtpCaldavEnabled,
- setIsEmailGroupEnabled,
setIsMultiWorkspaceEnabled,
- setIsEmailingDomainsEnabled,
+ setIsEmailingDomainInDemoMode,
setIsClickHouseConfigured,
setIsCloudflareIntegrationEnabled,
setIsDDLLocked,
diff --git a/packages/twenty-front/src/modules/client-config/states/isEmailGroupEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isEmailingDomainInDemoModeState.ts
similarity index 50%
rename from packages/twenty-front/src/modules/client-config/states/isEmailGroupEnabledState.ts
rename to packages/twenty-front/src/modules/client-config/states/isEmailingDomainInDemoModeState.ts
index bd2c215c9b7..024e224fbed 100644
--- a/packages/twenty-front/src/modules/client-config/states/isEmailGroupEnabledState.ts
+++ b/packages/twenty-front/src/modules/client-config/states/isEmailingDomainInDemoModeState.ts
@@ -1,6 +1,6 @@
import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
-export const isEmailGroupEnabledState = createAtomState<boolean>({
- key: 'isEmailGroupEnabled',
+export const isEmailingDomainInDemoModeState = createAtomState<boolean>({
+ key: 'isEmailingDomainInDemoMode',
defaultValue: false,
});
diff --git a/packages/twenty-front/src/modules/client-config/states/isEmailingDomainsEnabledState.ts b/packages/twenty-front/src/modules/client-config/states/isEmailingDomainsEnabledState.ts
deleted file mode 100644
index 4531b006694..00000000000
--- a/packages/twenty-front/src/modules/client-config/states/isEmailingDomainsEnabledState.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-import { createAtomState } from '@/ui/utilities/state/jotai/utils/createAtomState';
-
-export const isEmailingDomainsEnabledState = createAtomState<boolean>({
- key: 'isEmailingDomainsEnabled',
- defaultValue: false,
-});
diff --git a/packages/twenty-front/src/modules/client-config/types/ClientConfig.ts b/packages/twenty-front/src/modules/client-config/types/ClientConfig.ts
index 5624b80475f..d3f991210ed 100644
--- a/packages/twenty-front/src/modules/client-config/types/ClientConfig.ts
+++ b/packages/twenty-front/src/modules/client-config/types/ClientConfig.ts
@@ -31,8 +31,7 @@ export type ClientConfig = {
isMicrosoftMessagingEnabled: boolean;
isMultiWorkspaceEnabled: boolean;
isImapSmtpCaldavEnabled: boolean;
- isEmailGroupEnabled: boolean;
- isEmailingDomainsEnabled: boolean;
+ isEmailingDomainInDemoMode: boolean;
isCloudflareIntegrationEnabled: boolean;
isClickHouseConfigured: boolean;
isWorkspaceSchemaDDLLocked: boolean;
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/constants/EngineComponentKeyHeadlessComponentMap.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/constants/EngineComponentKeyHeadlessComponentMap.tsx
index bcc42b80323..367e638384b 100644
--- a/packages/twenty-front/src/modules/command-menu-item/engine-command/constants/EngineComponentKeyHeadlessComponentMap.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/constants/EngineComponentKeyHeadlessComponentMap.tsx
@@ -2,6 +2,7 @@ import { HeadlessFrontComponentRendererEngineCommand } from '@/command-menu-item
import { HeadlessNavigateEngineCommand } from '@/command-menu-item/engine-command/components/HeadlessNavigateEngineCommand';
import { HeadlessOpenSidePanelPageEngineCommand } from '@/command-menu-item/engine-command/components/HeadlessOpenSidePanelPageEngineCommand';
import { NavigationEngineCommand } from '@/command-menu-item/engine-command/components/NavigationEngineCommand';
+import { ComposeCampaignCommand } from '@/command-menu-item/engine-command/global/components/ComposeCampaignCommand';
import { ComposeEmailCommand } from '@/command-menu-item/engine-command/global/components/ComposeEmailCommand';
import { DeleteRecordsCommand } from '@/command-menu-item/engine-command/record/components/DeleteRecordsCommand';
import { DestroyRecordsCommand } from '@/command-menu-item/engine-command/record/components/DestroyRecordsCommand';
@@ -256,6 +257,7 @@ export const ENGINE_COMPONENT_KEY_COMPONENT_MAP: Record<
),
[EngineComponentKey.REPLY_TO_EMAIL_THREAD]: <ReplyToEmailThreadCommand />,
[EngineComponentKey.COMPOSE_EMAIL]: <ComposeEmailCommand />,
+ [EngineComponentKey.COMPOSE_CAMPAIGN]: <ComposeCampaignCommand />,
// Deprecated keys kept for backward compatibility until migration runs
[EngineComponentKey.DELETE_SINGLE_RECORD]: <DeleteRecordsCommand />,
diff --git a/packages/twenty-front/src/modules/command-menu-item/engine-command/global/components/ComposeCampaignCommand.tsx b/packages/twenty-front/src/modules/command-menu-item/engine-command/global/components/ComposeCampaignCommand.tsx
new file mode 100644
index 00000000000..0b94eedc850
--- /dev/null
+++ b/packages/twenty-front/src/modules/command-menu-item/engine-command/global/components/ComposeCampaignCommand.tsx
@@ -0,0 +1,13 @@
+import { HeadlessEngineCommandWrapperEffect } from '@/command-menu-item/engine-command/components/HeadlessEngineCommandWrapperEffect';
+import { useOpenCampaignComposerInSidePanel } from '@/side-panel/hooks/useOpenCampaignComposerInSidePanel';
+
+export const ComposeCampaignCommand = () => {
+ const { openCampaignComposerInSidePanel } =
+ useOpenCampaignComposerInSidePanel();
+
+ const handleExecute = () => {
+ openCampaignComposerInSidePanel();
+ };
+
+ return <HeadlessEngineCommandWrapperEffect execute={handleExecute} ready />;
+};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
index 9cfa062cca8..ec2d5e0014e 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
@@ -58,6 +58,7 @@ export type FormSingleRecordPickerProps = {
defaultValue?: RecordId | Variable | null;
onChange: (value: RecordId | Variable | null) => void;
onClear?: () => void;
+ onCreate?: (searchInput?: string) => void | Promise<void>;
objectNameSingulars: string[];
disabled?: boolean;
testId?: string;
@@ -70,6 +71,7 @@ export const FormSingleRecordPicker = ({
objectNameSingulars,
onChange,
onClear,
+ onCreate,
disabled,
testId,
VariablePicker,
@@ -137,6 +139,11 @@ export const FormSingleRecordPicker = ({
closeDropdown(dropdownId);
};
+ const handleCreateRecord = async (searchInput?: string) => {
+ await onCreate?.(searchInput);
+ closeDropdown(dropdownId);
+ };
+
const handleVariableTagInsert = (variable: string) => {
onChange?.(variable);
};
@@ -225,6 +232,7 @@ export const FormSingleRecordPicker = ({
EmptyIcon={IconForbid}
emptyLabel={t`No record`}
onCancel={() => closeDropdown(dropdownId)}
+ onCreate={isDefined(onCreate) ? handleCreateRecord : undefined}
onMorphItemSelected={handleMorphItemSelected}
objectNameSingulars={objectNameSingulars}
recordPickerInstanceId={dropdownId}
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx
index 3c7c0b6eaad..8d9e4c227a4 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsMessageChannelDetails.tsx
@@ -89,6 +89,8 @@ export const SettingsAccountsMessageChannelDetails = ({
const supportsFolderImportPolicy =
messageChannel.type === MessageChannelType.EMAIL;
+ const isGroupMailbox = messageChannel.type === MessageChannelType.EMAIL_GROUP;
+
return (
<StyledDetailsContainer>
{supportsFolderImportPolicy && (
@@ -103,21 +105,23 @@ export const SettingsAccountsMessageChannelDetails = ({
/>
</Section>
)}
- <Section>
- <Card rounded>
- <SettingsOptionCardContentToggle
- Icon={IconUsers}
- title={t`Exclude group emails`}
- description={t`Don't sync emails from team@ support@ noreply@...`}
- checked={messageChannel.excludeGroupEmails}
- onChange={() =>
- handleIsGroupEmailExcludedToggle(
- !messageChannel.excludeGroupEmails,
- )
- }
- />
- </Card>
- </Section>
+ {!isGroupMailbox && (
+ <Section>
+ <Card rounded>
+ <SettingsOptionCardContentToggle
+ Icon={IconUsers}
+ title={t`Exclude group emails`}
+ description={t`Don't sync emails from team@ support@ noreply@...`}
+ checked={messageChannel.excludeGroupEmails}
+ onChange={() =>
+ handleIsGroupEmailExcludedToggle(
+ !messageChannel.excludeGroupEmails,
+ )
+ }
+ />
+ </Card>
+ </Section>
+ )}
<Section>
<H2Title
title={t`Visibility`}
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsNewEmailGroupChannel.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsNewEmailGroupChannel.tsx
index 82d9c98262d..2779ec44113 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsNewEmailGroupChannel.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsNewEmailGroupChannel.tsx
@@ -39,14 +39,14 @@ export const SettingsAccountsNewEmailGroupChannel = () => {
}
} catch {
enqueueErrorSnackBar({
- message: t`Failed to create email handle. Email handles may not be configured on this server.`,
+ message: t`Failed to create email channel. Email channels may not be configured on this server.`,
});
}
}, [createEmailGroupChannel, handle, navigate, enqueueErrorSnackBar, t]);
return (
<SettingsPageLayout
- title={t`New Email Handle`}
+ title={t`New Email Channel`}
links={[
{
children: t`Workspace`,
@@ -56,7 +56,7 @@ export const SettingsAccountsNewEmailGroupChannel = () => {
children: t`Email`,
href: getSettingsPath(SettingsPath.WorkspaceEmail),
},
- { children: t`New Email Handle` },
+ { children: t`New Email Channel` },
]}
actionButton={
<SaveAndCancelButtons
diff --git a/packages/twenty-front/src/modules/settings/accounts/hooks/useCreateEmailGroupChannel.ts b/packages/twenty-front/src/modules/settings/accounts/hooks/useCreateEmailGroupChannel.ts
index df669f6ccc8..8f30838a95a 100644
--- a/packages/twenty-front/src/modules/settings/accounts/hooks/useCreateEmailGroupChannel.ts
+++ b/packages/twenty-front/src/modules/settings/accounts/hooks/useCreateEmailGroupChannel.ts
@@ -9,6 +9,7 @@ import {
import { CREATE_EMAIL_GROUP_CHANNEL } from '@/settings/accounts/graphql/mutations/createEmailGroupChannel';
import { GET_MY_CONNECTED_ACCOUNTS } from '@/settings/accounts/graphql/queries/getMyConnectedAccounts';
import { GET_MY_MESSAGE_CHANNELS } from '@/settings/accounts/graphql/queries/getMyMessageChannels';
+import { GET_ALL_EMAILING_DOMAINS } from '@/settings/emailing-domains/graphql/queries/getAllEmailingDomains';
type CreateEmailGroupChannelResult = {
createEmailGroupChannel: {
@@ -39,6 +40,7 @@ export const useCreateEmailGroupChannel = () => {
refetchQueries: [
{ query: GET_MY_CONNECTED_ACCOUNTS },
{ query: GET_MY_MESSAGE_CHANNELS },
+ { query: GET_ALL_EMAILING_DOMAINS },
],
});
diff --git a/packages/twenty-front/src/modules/settings/accounts/hooks/useDeleteEmailGroupChannel.ts b/packages/twenty-front/src/modules/settings/accounts/hooks/useDeleteEmailGroupChannel.ts
index 3fc400edb7d..353a79dbccf 100644
--- a/packages/twenty-front/src/modules/settings/accounts/hooks/useDeleteEmailGroupChannel.ts
+++ b/packages/twenty-front/src/modules/settings/accounts/hooks/useDeleteEmailGroupChannel.ts
@@ -3,6 +3,7 @@ import { useMutation } from '@apollo/client/react';
import { DELETE_EMAIL_GROUP_CHANNEL } from '@/settings/accounts/graphql/mutations/deleteEmailGroupChannel';
import { GET_MY_CONNECTED_ACCOUNTS } from '@/settings/accounts/graphql/queries/getMyConnectedAccounts';
import { GET_MY_MESSAGE_CHANNELS } from '@/settings/accounts/graphql/queries/getMyMessageChannels';
+import { GET_ALL_EMAILING_DOMAINS } from '@/settings/emailing-domains/graphql/queries/getAllEmailingDomains';
type DeleteEmailGroupChannelResult = {
deleteEmailGroupChannel: {
@@ -22,6 +23,7 @@ export const useDeleteEmailGroupChannel = () => {
refetchQueries: [
{ query: GET_MY_CONNECTED_ACCOUNTS },
{ query: GET_MY_MESSAGE_CHANNELS },
+ { query: GET_ALL_EMAILING_DOMAINS },
],
});
diff --git a/packages/twenty-front/src/modules/settings/accounts/utils/__tests__/getEmailChannelDomain.test.ts b/packages/twenty-front/src/modules/settings/accounts/utils/__tests__/getEmailChannelDomain.test.ts
new file mode 100644
index 00000000000..deb3e80507a
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/accounts/utils/__tests__/getEmailChannelDomain.test.ts
@@ -0,0 +1,22 @@
+import { getEmailChannelDomain } from '@/settings/accounts/utils/getEmailChannelDomain';
+
+describe('getEmailChannelDomain', () => {
+ it('should return the lowercased domain after the last @', () => {
+ expect(getEmailChannelDomain('[email protected]')).toBe('example.com');
+ });
+
+ it('should use the domain after the last @ when several are present', () => {
+ expect(getEmailChannelDomain('weird@[email protected]')).toBe(
+ 'sub.example.com',
+ );
+ });
+
+ it('should return undefined when there is no @', () => {
+ expect(getEmailChannelDomain('not-an-email')).toBeUndefined();
+ });
+
+ it('should return undefined for null or undefined input', () => {
+ expect(getEmailChannelDomain(null)).toBeUndefined();
+ expect(getEmailChannelDomain(undefined)).toBeUndefined();
+ });
+});
diff --git a/packages/twenty-front/src/modules/settings/accounts/utils/getEmailChannelDomain.ts b/packages/twenty-front/src/modules/settings/accounts/utils/getEmailChannelDomain.ts
new file mode 100644
index 00000000000..692432caee8
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/accounts/utils/getEmailChannelDomain.ts
@@ -0,0 +1,15 @@
+export const getEmailChannelDomain = (
+ handle: string | null | undefined,
+): string | undefined => {
+ if (handle === null || handle === undefined) {
+ return undefined;
+ }
+
+ const lastAtIndex = handle.lastIndexOf('@');
+
+ if (lastAtIndex === -1) {
+ return undefined;
+ }
+
+ return handle.slice(lastAtIndex + 1).toLowerCase();
+};
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsTableListSection.tsx b/packages/twenty-front/src/modules/settings/components/SettingsTableListSection.tsx
index ce38673fdf0..0dd7a61093e 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsTableListSection.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsTableListSection.tsx
@@ -1,4 +1,4 @@
-import { type ComponentType } from 'react';
+import { type ComponentType, type ReactNode } from 'react';
import { styled } from '@linaria/react';
@@ -48,6 +48,7 @@ export type SettingsTableListSectionColumn<Item> = {
type SettingsTableListSectionProps<Item extends { id: string }> = {
title: string;
description: string;
+ headerAdornment?: ReactNode;
items: Item[];
columns: SettingsTableListSectionColumn<Item>[];
gridAutoColumns: string;
@@ -61,6 +62,7 @@ export const SettingsTableListSection = <
>({
title,
description,
+ headerAdornment,
items,
columns,
gridAutoColumns,
@@ -69,7 +71,11 @@ export const SettingsTableListSection = <
onFooterButtonClick,
}: SettingsTableListSectionProps<Item>) => (
<Section>
- <H2Title title={title} description={description} />
+ <H2Title
+ title={title}
+ description={description}
+ adornment={headerAdornment}
+ />
{items.length > 0 && (
<Table>
<TableRow gridAutoColumns={gridAutoColumns}>
diff --git a/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainNameCell.tsx b/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainNameCell.tsx
deleted file mode 100644
index dc4f7215633..00000000000
--- a/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainNameCell.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { styled } from '@linaria/react';
-
-import { type GetEmailingDomainsQuery } from '~/generated-metadata/graphql';
-import {
- IconMail,
- OverflowingTextWithTooltip,
-} from 'twenty-ui-deprecated/display';
-import { themeCssVariables } from 'twenty-ui-deprecated/theme-constants';
-
-const StyledNameCell = styled.div`
- align-items: center;
- color: ${themeCssVariables.font.color.primary};
- display: flex;
- font-weight: ${themeCssVariables.font.weight.medium};
- gap: ${themeCssVariables.spacing[2]};
- min-width: 0;
-`;
-
-type SettingsEmailingDomainNameCellProps = {
- item: GetEmailingDomainsQuery['getEmailingDomains'][0];
-};
-
-export const SettingsEmailingDomainNameCell = ({
- item,
-}: SettingsEmailingDomainNameCellProps) => (
- <StyledNameCell>
- <IconMail size={16} />
- <OverflowingTextWithTooltip text={item.domain} />
- </StyledNameCell>
-);
diff --git a/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainStatusCell.tsx b/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainStatusCell.tsx
deleted file mode 100644
index 4810ee06bc0..00000000000
--- a/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainStatusCell.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { type GetEmailingDomainsQuery } from '~/generated-metadata/graphql';
-import { getColorByEmailingDomainStatus } from '~/pages/settings/emailing-domains/utils/getEmailingDomainStatusColor';
-import { getTextByEmailingDomainStatus } from '~/pages/settings/emailing-domains/utils/getEmailingDomainStatusText';
-import { Status } from 'twenty-ui-deprecated/display';
-
-type SettingsEmailingDomainStatusCellProps = {
- item: GetEmailingDomainsQuery['getEmailingDomains'][0];
-};
-
-export const SettingsEmailingDomainStatusCell = ({
- item,
-}: SettingsEmailingDomainStatusCellProps) => (
- <Status
- color={getColorByEmailingDomainStatus(item.status)}
- text={getTextByEmailingDomainStatus(item.status)}
- />
-);
diff --git a/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainVerificationRecords.tsx b/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainVerificationRecords.tsx
deleted file mode 100644
index 8b8c87aa1b9..00000000000
--- a/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainVerificationRecords.tsx
+++ /dev/null
@@ -1,70 +0,0 @@
-import { SettingsDnsRecordsTable } from '@/settings/components/SettingsDnsRecordsTable';
-
-import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
-import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { t } from '@lingui/core/macro';
-import { H2Title, IconRefresh } from 'twenty-ui-deprecated/display';
-import { Button } from 'twenty-ui-deprecated/input';
-
-import { Section } from 'twenty-ui-deprecated/layout';
-import { useMutation } from '@apollo/client/react';
-import {
- type EmailingDomain,
- VerifyEmailingDomainDocument,
-} from '~/generated-metadata/graphql';
-
-type SettingsEmailingDomainVerificationRecordsProps = {
- domain: EmailingDomain;
-};
-
-export const SettingsEmailingDomainVerificationRecords = ({
- domain,
-}: SettingsEmailingDomainVerificationRecordsProps) => {
- const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();
-
- const [verifyEmailingDomainMutation, { loading: isVerifying }] = useMutation(
- VerifyEmailingDomainDocument,
- );
-
- if (!domain.verificationRecords || domain.verificationRecords.length === 0) {
- return null;
- }
-
- const handleVerifyEmailingDomain = async () => {
- try {
- await verifyEmailingDomainMutation({
- variables: {
- id: domain.id,
- },
- });
- enqueueSuccessSnackBar({
- message: t`Started verification process`,
- });
- } catch (error) {
- enqueueErrorSnackBar({
- ...(CombinedGraphQLErrors.is(error) ? { apolloError: error } : {}),
- });
- }
- };
-
- return (
- <Section>
- <H2Title
- title={t`DNS Records`}
- description={t`Add these records to verify your domain.`}
- adornment={
- <Button
- onClick={handleVerifyEmailingDomain}
- isLoading={isVerifying}
- variant="secondary"
- Icon={IconRefresh}
- size="small"
- title={t`Check verification`}
- disabled={isVerifying}
- />
- }
- />
- <SettingsDnsRecordsTable records={domain.verificationRecords} />
- </Section>
- );
-};
diff --git a/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainVerifyButton.tsx b/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainVerifyButton.tsx
new file mode 100644
index 00000000000..985d1a6d3c4
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/emailing-domains/components/SettingsEmailingDomainVerifyButton.tsx
@@ -0,0 +1,45 @@
+import { CombinedGraphQLErrors } from '@apollo/client/errors';
+import { useMutation } from '@apollo/client/react';
+import { useLingui } from '@lingui/react/macro';
+
+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { VerifyEmailingDomainDocument } from '~/generated-metadata/graphql';
+import { IconRefresh } from 'twenty-ui-deprecated/display';
+import { Button } from 'twenty-ui-deprecated/input';
+
+type SettingsEmailingDomainVerifyButtonProps = {
+ emailingDomainId: string;
+};
+
+export const SettingsEmailingDomainVerifyButton = ({
+ emailingDomainId,
+}: SettingsEmailingDomainVerifyButtonProps) => {
+ const { t } = useLingui();
+ const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();
+ const [verifyEmailingDomain, { loading }] = useMutation(
+ VerifyEmailingDomainDocument,
+ );
+
+ const handleVerify = async () => {
+ try {
+ await verifyEmailingDomain({ variables: { id: emailingDomainId } });
+ enqueueSuccessSnackBar({ message: t`Started verification process` });
+ } catch (error) {
+ enqueueErrorSnackBar({
+ ...(CombinedGraphQLErrors.is(error) ? { apolloError: error } : {}),
+ });
+ }
+ };
+
+ return (
+ <Button
+ onClick={handleVerify}
+ isLoading={loading}
+ variant="secondary"
+ Icon={IconRefresh}
+ size="small"
+ title={t`Check verification`}
+ disabled={loading}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/emailing-domains/graphql/mutations/createEmailingDomain.ts b/packages/twenty-front/src/modules/settings/emailing-domains/graphql/mutations/createEmailingDomain.ts
deleted file mode 100644
index 8f67b16f983..00000000000
--- a/packages/twenty-front/src/modules/settings/emailing-domains/graphql/mutations/createEmailingDomain.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { gql } from '@apollo/client';
-
-export const CREATE_EMAILING_DOMAIN = gql`
- mutation CreateEmailingDomain($domain: String!) {
- createEmailingDomain(domain: $domain) {
- id
- domain
- status
- verifiedAt
- verificationRecords {
- type
- key
- value
- priority
- }
- createdAt
- updatedAt
- }
- }
-`;
diff --git a/packages/twenty-front/src/modules/settings/unsubscribe-topics/components/SettingsWorkspaceUnsubscribeTopicSection.tsx b/packages/twenty-front/src/modules/settings/unsubscribe-topics/components/SettingsWorkspaceUnsubscribeTopicSection.tsx
new file mode 100644
index 00000000000..c42213b43d8
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/unsubscribe-topics/components/SettingsWorkspaceUnsubscribeTopicSection.tsx
@@ -0,0 +1,86 @@
+import { useLazyQuery } from '@apollo/client/react';
+import { useLingui } from '@lingui/react/macro';
+
+import { useUnsubscribeTopics } from '@/activities/emails/hooks/useUnsubscribeTopics';
+import { SettingsTableListSection } from '@/settings/components/SettingsTableListSection';
+import { GET_UNSUBSCRIBE_PAGE_PREVIEW_URL } from '@/settings/unsubscribe-topics/graphql/queries/getUnsubscribePagePreviewUrl';
+import { SettingsPath } from 'twenty-shared/types';
+import { isDefined } from 'twenty-shared/utils';
+import {
+ type UnsubscribeTopicsQuery,
+ UnsubscribeTopicVisibility,
+} from '~/generated-metadata/graphql';
+import { IconExternalLink, Status } from 'twenty-ui-deprecated/display';
+import { Button } from 'twenty-ui-deprecated/input';
+import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+
+type UnsubscribeTopic = UnsubscribeTopicsQuery['unsubscribeTopics'][number];
+
+export const SettingsWorkspaceUnsubscribeTopicSection = () => {
+ const { t } = useLingui();
+ const navigateSettings = useNavigateSettings();
+ const { unsubscribeTopics } = useUnsubscribeTopics();
+ const [getPreviewUrl] = useLazyQuery<{
+ unsubscribePagePreviewUrl: string;
+ }>(GET_UNSUBSCRIBE_PAGE_PREVIEW_URL);
+
+ // Open the tab synchronously on click (so it isn't popup-blocked), then point
+ // it at the freshly minted preview URL once the query resolves.
+ const handlePreview = () => {
+ const previewWindow = window.open('', '_blank');
+
+ void getPreviewUrl()
+ .then(({ data }) => {
+ const url = data?.unsubscribePagePreviewUrl;
+
+ if (isDefined(previewWindow) && isDefined(url)) {
+ previewWindow.location.href = url;
+ } else {
+ previewWindow?.close();
+ }
+ })
+ .catch(() => previewWindow?.close());
+ };
+
+ return (
+ <SettingsTableListSection<UnsubscribeTopic>
+ title={t`Unsubscribe Topics`}
+ description={t`Email categories recipients can opt out of.`}
+ headerAdornment={
+ <Button
+ title={t`Preview`}
+ variant="secondary"
+ size="small"
+ Icon={IconExternalLink}
+ onClick={handlePreview}
+ />
+ }
+ items={unsubscribeTopics}
+ columns={[
+ {
+ label: t`Name`,
+ Cell: ({ item }) => <>{item.name ?? t`Untitled topic`}</>,
+ },
+ {
+ label: t`Visibility`,
+ Cell: ({ item }) =>
+ item.visibility === UnsubscribeTopicVisibility.PUBLIC ? (
+ <Status color="blue" text={t`Public`} />
+ ) : (
+ <Status color="gray" text={t`Private`} />
+ ),
+ },
+ ]}
+ gridAutoColumns="1fr 1fr"
+ onRowClick={(topic) =>
+ navigateSettings(SettingsPath.UnsubscribeTopicDetail, {
+ unsubscribeTopicId: topic.id,
+ })
+ }
+ footerButtonLabel={t`Add unsubscribe topic`}
+ onFooterButtonClick={() =>
+ navigateSettings(SettingsPath.NewUnsubscribeTopic)
+ }
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/mutations/createUnsubscribeTopic.ts b/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/mutations/createUnsubscribeTopic.ts
new file mode 100644
index 00000000000..20d17384781
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/mutations/createUnsubscribeTopic.ts
@@ -0,0 +1,12 @@
+import { gql } from '@apollo/client';
+
+export const CREATE_UNSUBSCRIBE_TOPIC = gql`
+ mutation CreateUnsubscribeTopic($input: CreateUnsubscribeTopicInput!) {
+ createUnsubscribeTopic(input: $input) {
+ id
+ name
+ description
+ visibility
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/mutations/deleteUnsubscribeTopic.ts b/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/mutations/deleteUnsubscribeTopic.ts
new file mode 100644
index 00000000000..fb662119f80
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/mutations/deleteUnsubscribeTopic.ts
@@ -0,0 +1,7 @@
+import { gql } from '@apollo/client';
+
+export const DELETE_UNSUBSCRIBE_TOPIC = gql`
+ mutation DeleteUnsubscribeTopic($id: String!) {
+ deleteUnsubscribeTopic(id: $id)
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/mutations/updateUnsubscribeTopic.ts b/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/mutations/updateUnsubscribeTopic.ts
new file mode 100644
index 00000000000..05bdd34d5b2
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/mutations/updateUnsubscribeTopic.ts
@@ -0,0 +1,12 @@
+import { gql } from '@apollo/client';
+
+export const UPDATE_UNSUBSCRIBE_TOPIC = gql`
+ mutation UpdateUnsubscribeTopic($input: UpdateUnsubscribeTopicInput!) {
+ updateUnsubscribeTopic(input: $input) {
+ id
+ name
+ description
+ visibility
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/queries/getUnsubscribePagePreviewUrl.ts b/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/queries/getUnsubscribePagePreviewUrl.ts
new file mode 100644
index 00000000000..84cc46948dd
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/unsubscribe-topics/graphql/queries/getUnsubscribePagePreviewUrl.ts
@@ -0,0 +1,7 @@
+import { gql } from '@apollo/client';
+
+export const GET_UNSUBSCRIBE_PAGE_PREVIEW_URL = gql`
+ query UnsubscribePagePreviewUrl {
+ unsubscribePagePreviewUrl
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/unsubscribe-topics/hooks/useCreateUnsubscribeTopic.ts b/packages/twenty-front/src/modules/settings/unsubscribe-topics/hooks/useCreateUnsubscribeTopic.ts
new file mode 100644
index 00000000000..12c29af37cd
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/unsubscribe-topics/hooks/useCreateUnsubscribeTopic.ts
@@ -0,0 +1,23 @@
+import { useMutation } from '@apollo/client/react';
+
+import { UNSUBSCRIBE_TOPICS } from '@/activities/emails/graphql/metadata-queries/unsubscribeTopics';
+import { CREATE_UNSUBSCRIBE_TOPIC } from '@/settings/unsubscribe-topics/graphql/mutations/createUnsubscribeTopic';
+import {
+ type CreateUnsubscribeTopicInput,
+ type CreateUnsubscribeTopicMutation,
+ type CreateUnsubscribeTopicMutationVariables,
+} from '~/generated-metadata/graphql';
+
+export const useCreateUnsubscribeTopic = () => {
+ const [mutate, { loading, error }] = useMutation<
+ CreateUnsubscribeTopicMutation,
+ CreateUnsubscribeTopicMutationVariables
+ >(CREATE_UNSUBSCRIBE_TOPIC, {
+ refetchQueries: [{ query: UNSUBSCRIBE_TOPICS }],
+ });
+
+ const createUnsubscribeTopic = (input: CreateUnsubscribeTopicInput) =>
+ mutate({ variables: { input } });
+
+ return { createUnsubscribeTopic, loading, error };
+};
diff --git a/packages/twenty-front/src/modules/settings/unsubscribe-topics/hooks/useDeleteUnsubscribeTopic.ts b/packages/twenty-front/src/modules/settings/unsubscribe-topics/hooks/useDeleteUnsubscribeTopic.ts
new file mode 100644
index 00000000000..fdd0dbb9606
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/unsubscribe-topics/hooks/useDeleteUnsubscribeTopic.ts
@@ -0,0 +1,21 @@
+import { useMutation } from '@apollo/client/react';
+
+import { UNSUBSCRIBE_TOPICS } from '@/activities/emails/graphql/metadata-queries/unsubscribeTopics';
+import { DELETE_UNSUBSCRIBE_TOPIC } from '@/settings/unsubscribe-topics/graphql/mutations/deleteUnsubscribeTopic';
+import {
+ type DeleteUnsubscribeTopicMutation,
+ type DeleteUnsubscribeTopicMutationVariables,
+} from '~/generated-metadata/graphql';
+
+export const useDeleteUnsubscribeTopic = () => {
+ const [mutate, { loading, error }] = useMutation<
+ DeleteUnsubscribeTopicMutation,
+ DeleteUnsubscribeTopicMutationVariables
+ >(DELETE_UNSUBSCRIBE_TOPIC, {
+ refetchQueries: [{ query: UNSUBSCRIBE_TOPICS }],
+ });
+
+ const deleteUnsubscribeTopic = (id: string) => mutate({ variables: { id } });
+
+ return { deleteUnsubscribeTopic, loading, error };
+};
diff --git a/packages/twenty-front/src/modules/settings/unsubscribe-topics/hooks/useUpdateUnsubscribeTopic.ts b/packages/twenty-front/src/modules/settings/unsubscribe-topics/hooks/useUpdateUnsubscribeTopic.ts
new file mode 100644
index 00000000000..73be985dfd9
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/unsubscribe-topics/hooks/useUpdateUnsubscribeTopic.ts
@@ -0,0 +1,23 @@
+import { useMutation } from '@apollo/client/react';
+
+import { UNSUBSCRIBE_TOPICS } from '@/activities/emails/graphql/metadata-queries/unsubscribeTopics';
+import { UPDATE_UNSUBSCRIBE_TOPIC } from '@/settings/unsubscribe-topics/graphql/mutations/updateUnsubscribeTopic';
+import {
+ type UpdateUnsubscribeTopicInput,
+ type UpdateUnsubscribeTopicMutation,
+ type UpdateUnsubscribeTopicMutationVariables,
+} from '~/generated-metadata/graphql';
+
+export const useUpdateUnsubscribeTopic = () => {
+ const [mutate, { loading, error }] = useMutation<
+ UpdateUnsubscribeTopicMutation,
+ UpdateUnsubscribeTopicMutationVariables
+ >(UPDATE_UNSUBSCRIBE_TOPIC, {
+ refetchQueries: [{ query: UNSUBSCRIBE_TOPICS }],
+ });
+
+ const updateUnsubscribeTopic = (input: UpdateUnsubscribeTopicInput) =>
+ mutate({ variables: { input } });
+
+ return { updateUnsubscribeTopic, loading, error };
+};
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailChannelDomainStatusCell.tsx b/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailChannelDomainStatusCell.tsx
new file mode 100644
index 00000000000..897cc1fce5c
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailChannelDomainStatusCell.tsx
@@ -0,0 +1,35 @@
+import { useQuery } from '@apollo/client/react';
+
+import { type MessageChannel } from '@/accounts/types/MessageChannel';
+import { getEmailChannelDomain } from '@/settings/accounts/utils/getEmailChannelDomain';
+import { GetEmailingDomainsDocument } from '~/generated-metadata/graphql';
+import { getColorByEmailingDomainStatus } from '~/pages/settings/emailing-domains/utils/getEmailingDomainStatusColor';
+import { getTextByEmailingDomainStatus } from '~/pages/settings/emailing-domains/utils/getEmailingDomainStatusText';
+import { isDefined } from 'twenty-shared/utils';
+import { Status } from 'twenty-ui-deprecated/display';
+
+type SettingsWorkspaceEmailChannelDomainStatusCellProps = {
+ item: MessageChannel;
+};
+
+export const SettingsWorkspaceEmailChannelDomainStatusCell = ({
+ item,
+}: SettingsWorkspaceEmailChannelDomainStatusCellProps) => {
+ const { data } = useQuery(GetEmailingDomainsDocument);
+
+ const channelDomain = getEmailChannelDomain(item.connectedAccount?.handle);
+ const emailingDomain = data?.getEmailingDomains?.find(
+ (domain) => domain.domain.toLowerCase() === channelDomain,
+ );
+
+ if (!isDefined(emailingDomain)) {
+ return null;
+ }
+
+ return (
+ <Status
+ color={getColorByEmailingDomainStatus(emailingDomain.status)}
+ text={getTextByEmailingDomainStatus(emailingDomain.status)}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailGroupSection.tsx b/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailGroupSection.tsx
index afb2d992c68..f1cb1298511 100644
--- a/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailGroupSection.tsx
+++ b/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailGroupSection.tsx
@@ -3,6 +3,7 @@ import { useLingui } from '@lingui/react/macro';
import { type MessageChannel } from '@/accounts/types/MessageChannel';
import { useMyMessageChannels } from '@/settings/accounts/hooks/useMyMessageChannels';
import { SettingsTableListSection } from '@/settings/components/SettingsTableListSection';
+import { SettingsWorkspaceEmailChannelDomainStatusCell } from '@/settings/workspace/components/SettingsWorkspaceEmailChannelDomainStatusCell';
import { SettingsWorkspaceEmailGroupForwardingCell } from '@/settings/workspace/components/SettingsWorkspaceEmailGroupForwardingCell';
import { SettingsWorkspaceEmailGroupSourceCell } from '@/settings/workspace/components/SettingsWorkspaceEmailGroupSourceCell';
import { MessageChannelType, SettingsPath } from 'twenty-shared/types';
@@ -19,7 +20,7 @@ export const SettingsWorkspaceEmailGroupSection = () => {
return (
<SettingsTableListSection<MessageChannel>
- title={t`Email Handles`}
+ title={t`Email Channels`}
description={t`Shared addresses your workspace uses to send and receive email.`}
items={emailGroupChannels}
columns={[
@@ -28,14 +29,19 @@ export const SettingsWorkspaceEmailGroupSection = () => {
label: t`Forwarding address`,
Cell: SettingsWorkspaceEmailGroupForwardingCell,
},
+ {
+ label: t`Domain`,
+ align: 'right',
+ Cell: SettingsWorkspaceEmailChannelDomainStatusCell,
+ },
]}
- gridAutoColumns="1fr 1fr"
+ gridAutoColumns="1fr 1fr 1fr"
onRowClick={(channel) =>
navigateSettings(SettingsPath.EmailGroupChannelDetail, {
messageChannelId: channel.id,
})
}
- footerButtonLabel={t`Add email handle`}
+ footerButtonLabel={t`Add email channel`}
onFooterButtonClick={() =>
navigateSettings(SettingsPath.NewEmailGroupChannel)
}
diff --git a/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailingDomainsSection.tsx b/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailingDomainsSection.tsx
deleted file mode 100644
index e8cb1bdcbd0..00000000000
--- a/packages/twenty-front/src/modules/settings/workspace/components/SettingsWorkspaceEmailingDomainsSection.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { useLingui } from '@lingui/react/macro';
-import { useQuery } from '@apollo/client/react';
-
-import { SettingsTableListSection } from '@/settings/components/SettingsTableListSection';
-import { SettingsEmailingDomainNameCell } from '@/settings/emailing-domains/components/SettingsEmailingDomainNameCell';
-import { SettingsEmailingDomainStatusCell } from '@/settings/emailing-domains/components/SettingsEmailingDomainStatusCell';
-import { SettingsPath } from 'twenty-shared/types';
-import {
- type GetEmailingDomainsQuery,
- GetEmailingDomainsDocument,
-} from '~/generated-metadata/graphql';
-import { useNavigateSettings } from '~/hooks/useNavigateSettings';
-
-type EmailingDomain = GetEmailingDomainsQuery['getEmailingDomains'][0];
-
-export const SettingsWorkspaceEmailingDomainsSection = () => {
- const { t } = useLingui();
- const navigateSettings = useNavigateSettings();
-
- const { data } = useQuery(GetEmailingDomainsDocument);
- const emailingDomains = data?.getEmailingDomains ?? [];
-
- return (
- <SettingsTableListSection<EmailingDomain>
- title={t`Emailing Domains`}
- description={t`Verify domains so the workspace can send outbound email through them.`}
- items={emailingDomains}
- columns={[
- { label: t`Domain`, Cell: SettingsEmailingDomainNameCell },
- {
- label: t`Status`,
- align: 'right',
- Cell: SettingsEmailingDomainStatusCell,
- },
- ]}
- gridAutoColumns="1fr 1fr"
- onRowClick={(emailingDomain) =>
- navigateSettings(SettingsPath.EmailingDomainDetail, {
- domainId: emailingDomain.id,
- })
- }
- footerButtonLabel={t`Add emailing domain`}
- onFooterButtonClick={() =>
- navigateSettings(SettingsPath.NewEmailingDomain)
- }
- />
- );
-};
diff --git a/packages/twenty-front/src/modules/side-panel/constants/SidePanelPagesConfig.tsx b/packages/twenty-front/src/modules/side-panel/constants/SidePanelPagesConfig.tsx
index efcebc7f12d..fc3a017c3cc 100644
--- a/packages/twenty-front/src/modules/side-panel/constants/SidePanelPagesConfig.tsx
+++ b/packages/twenty-front/src/modules/side-panel/constants/SidePanelPagesConfig.tsx
@@ -5,6 +5,7 @@ import { SidePanelNewSidebarItemPage } from '@/navigation-menu-item/edit/side-pa
import { SidePanelAiChatThreadsPage } from '@/side-panel/pages/ai-chat-threads/components/SidePanelAiChatThreadsPage';
import { SidePanelAskAiPage } from '@/side-panel/pages/ask-ai/components/SidePanelAskAiPage';
import { SidePanelCalendarEventPage } from '@/side-panel/pages/calendar-event/components/SidePanelCalendarEventPage';
+import { SidePanelCampaignComposerPage } from '@/side-panel/pages/compose-campaign/components/SidePanelCampaignComposerPage';
import { SidePanelComposeEmailPage } from '@/side-panel/pages/compose-email/components/SidePanelComposeEmailPage';
import { SidePanelFrontComponentPage } from '@/side-panel/pages/front-component/components/SidePanelFrontComponentPage';
import { SidePanelDashboardChartSettings } from '@/side-panel/pages/page-layout/components/dashboard/SidePanelDashboardChartSettings';
@@ -88,5 +89,6 @@ export const SIDE_PANEL_PAGES_CONFIG = new Map<SidePanelPages, React.ReactNode>(
[SidePanelPages.NavigationMenuAddItem, <SidePanelNewSidebarItemPage />],
[SidePanelPages.CommandMenuEdit, <SidePanelCommandMenuItemEditPage />],
[SidePanelPages.ComposeEmail, <SidePanelComposeEmailPage />],
+ [SidePanelPages.ComposeCampaign, <SidePanelCampaignComposerPage />],
],
);
diff --git a/packages/twenty-front/src/modules/side-panel/hooks/useOpenCampaignComposerInSidePanel.ts b/packages/twenty-front/src/modules/side-panel/hooks/useOpenCampaignComposerInSidePanel.ts
new file mode 100644
index 00000000000..ab85bda07a9
--- /dev/null
+++ b/packages/twenty-front/src/modules/side-panel/hooks/useOpenCampaignComposerInSidePanel.ts
@@ -0,0 +1,23 @@
+import { useCallback } from 'react';
+
+import { SidePanelPages } from 'twenty-shared/types';
+import { IconSend } from 'twenty-ui-deprecated/display';
+import { v4 } from 'uuid';
+
+import { useSidePanelMenu } from '@/side-panel/hooks/useSidePanelMenu';
+import { t } from '@lingui/core/macro';
+
+export const useOpenCampaignComposerInSidePanel = () => {
+ const { navigateSidePanelMenu } = useSidePanelMenu();
+
+ const openCampaignComposerInSidePanel = useCallback(() => {
+ navigateSidePanelMenu({
+ page: SidePanelPages.ComposeCampaign,
+ pageTitle: t`New Campaign`,
+ pageIcon: IconSend,
+ pageId: v4(),
+ });
+ }, [navigateSidePanelMenu]);
+
+ return { openCampaignComposerInSidePanel };
+};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/compose-campaign/components/SidePanelCampaignComposerPage.tsx b/packages/twenty-front/src/modules/side-panel/pages/compose-campaign/components/SidePanelCampaignComposerPage.tsx
new file mode 100644
index 00000000000..3234206fd57
--- /dev/null
+++ b/packages/twenty-front/src/modules/side-panel/pages/compose-campaign/components/SidePanelCampaignComposerPage.tsx
@@ -0,0 +1,69 @@
+import { CampaignComposerFields } from '@/activities/emails/components/CampaignComposerFields';
+import { useCampaignComposerState } from '@/activities/emails/hooks/useCampaignComposerState';
+import { SIDE_PANEL_FOCUS_ID } from '@/side-panel/constants/SidePanelFocusId';
+import { useSidePanelHistory } from '@/side-panel/hooks/useSidePanelHistory';
+import { SidePanelFooter } from '@/ui/layout/side-panel/components/SidePanelFooter';
+import { useHotkeysOnFocusedElement } from '@/ui/utilities/hotkey/hooks/useHotkeysOnFocusedElement';
+import { styled } from '@linaria/react';
+import { t } from '@lingui/core/macro';
+import { IconSend } from 'twenty-ui-deprecated/display';
+import { Button } from 'twenty-ui-deprecated/input';
+import { getOsControlSymbol } from 'twenty-ui-deprecated/utilities';
+
+const StyledContainer = styled.div`
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+`;
+
+const StyledContent = styled.div`
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ overflow-y: auto;
+`;
+
+export const SidePanelCampaignComposerPage = () => {
+ const { goBackFromSidePanel } = useSidePanelHistory();
+
+ const campaignState = useCampaignComposerState({
+ onSent: goBackFromSidePanel,
+ });
+
+ useHotkeysOnFocusedElement({
+ keys: ['ctrl+Enter,meta+Enter'],
+ callback: campaignState.handleSend,
+ focusId: SIDE_PANEL_FOCUS_ID,
+ dependencies: [campaignState.handleSend],
+ });
+
+ return (
+ <StyledContainer>
+ <StyledContent>
+ <CampaignComposerFields campaignState={campaignState} />
+ </StyledContent>
+ <SidePanelFooter
+ actions={[
+ <Button
+ key="cancel"
+ size="small"
+ variant="secondary"
+ title={t`Cancel`}
+ onClick={goBackFromSidePanel}
+ />,
+ <Button
+ key="send"
+ size="small"
+ variant="primary"
+ accent="blue"
+ title={t`Send campaign`}
+ Icon={IconSend}
+ hotkeys={[getOsControlSymbol(), '⏎']}
+ onClick={campaignState.handleSend}
+ disabled={!campaignState.canSend}
+ />,
+ ]}
+ />
+ </StyledContainer>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceEmail.tsx b/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceEmail.tsx
index 37487080e27..37a057cc399 100644
--- a/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceEmail.tsx
+++ b/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceEmail.tsx
@@ -1,19 +1,31 @@
import { useLingui } from '@lingui/react/macro';
-import { isEmailGroupEnabledState } from '@/client-config/states/isEmailGroupEnabledState';
+import { billingState } from '@/client-config/states/billingState';
+import { isEmailingDomainInDemoModeState } from '@/client-config/states/isEmailingDomainInDemoModeState';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
+import { SettingsOptionCardContentButton } from '@/settings/components/SettingsOptions/SettingsOptionCardContentButton';
+import { SettingsWorkspaceUnsubscribeTopicSection } from '@/settings/unsubscribe-topics/components/SettingsWorkspaceUnsubscribeTopicSection';
import { SettingsWorkspaceEmailGroupSection } from '@/settings/workspace/components/SettingsWorkspaceEmailGroupSection';
-import { SettingsWorkspaceEmailingDomainsSection } from '@/settings/workspace/components/SettingsWorkspaceEmailingDomainsSection';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { FeatureFlagKey, SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
+import { IconArrowUp, IconLock } from 'twenty-ui-deprecated/display';
+import { Button } from 'twenty-ui-deprecated/input';
+import { Card } from 'twenty-ui-deprecated/layout';
+import { themeCssVariables } from 'twenty-ui-deprecated/theme-constants';
+import { useNavigateSettings } from '~/hooks/useNavigateSettings';
export const SettingsWorkspaceEmail = () => {
const { t } = useLingui();
+ const navigateSettings = useNavigateSettings();
- const isEmailGroupEnabled = useAtomStateValue(isEmailGroupEnabledState);
+ const isEmailingDomainInDemoMode = useAtomStateValue(
+ isEmailingDomainInDemoModeState,
+ );
+ const billing = useAtomStateValue(billingState);
+ const isBillingEnabled = billing?.isBillingEnabled ?? false;
const isEmailGroupFeatureEnabled = useIsFeatureEnabled(
FeatureFlagKey.IS_EMAIL_GROUP_ENABLED,
);
@@ -22,8 +34,6 @@ export const SettingsWorkspaceEmail = () => {
return null;
}
- const showEmailGroupSection = isEmailGroupEnabled;
-
return (
<SettingsPageLayout
title={t`Email`}
@@ -36,8 +46,36 @@ export const SettingsWorkspaceEmail = () => {
]}
>
<SettingsPageContainer>
- {showEmailGroupSection && <SettingsWorkspaceEmailGroupSection />}
- <SettingsWorkspaceEmailingDomainsSection />
+ {isEmailingDomainInDemoMode && (
+ <Card
+ rounded
+ backgroundColor={themeCssVariables.background.secondary}
+ >
+ <SettingsOptionCardContentButton
+ Icon={IconLock}
+ title={t`Emailing is in demo mode`}
+ description={t`Emails are logged, not sent. Sending requires the AWS SES driver with an Enterprise license, or Twenty Cloud.`}
+ Button={
+ <Button
+ title={t`Upgrade`}
+ variant="primary"
+ accent="blue"
+ size="small"
+ Icon={IconArrowUp}
+ onClick={() =>
+ navigateSettings(
+ isBillingEnabled
+ ? SettingsPath.Billing
+ : SettingsPath.AdminPanelEnterprise,
+ )
+ }
+ />
+ }
+ />
+ </Card>
+ )}
+ <SettingsWorkspaceEmailGroupSection />
+ <SettingsWorkspaceUnsubscribeTopicSection />
</SettingsPageContainer>
</SettingsPageLayout>
);
diff --git a/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx b/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
index 1c8ce21f375..f6cca846c16 100644
--- a/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
+++ b/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceEmailGroupChannelDetail.tsx
@@ -1,3 +1,4 @@
+import { useQuery } from '@apollo/client/react';
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { useParams } from 'react-router-dom';
@@ -5,7 +6,11 @@ import { useParams } from 'react-router-dom';
import { SettingsAccountsMessageChannelDetails } from '@/settings/accounts/components/SettingsAccountsMessageChannelDetails';
import { useDeleteEmailGroupChannel } from '@/settings/accounts/hooks/useDeleteEmailGroupChannel';
import { useMyMessageChannels } from '@/settings/accounts/hooks/useMyMessageChannels';
+import { getEmailChannelDomain } from '@/settings/accounts/utils/getEmailChannelDomain';
+import { SettingsDnsRecordsTable } from '@/settings/components/SettingsDnsRecordsTable';
+import { SettingsEmailingDomainVerifyButton } from '@/settings/emailing-domains/components/SettingsEmailingDomainVerifyButton';
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
+import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
@@ -13,24 +18,24 @@ import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModa
import { useModal } from '@/ui/layout/modal/hooks/useModal';
import { MessageChannelType, SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
-import { H2Title, IconCopy, IconTrash } from 'twenty-ui-deprecated/display';
-import { Loader } from 'twenty-ui-deprecated/feedback';
+import { GetEmailingDomainsDocument } from '~/generated-metadata/graphql';
+import {
+ H2Title,
+ IconCopy,
+ IconTrash,
+ Status,
+} from 'twenty-ui-deprecated/display';
import { Button } from 'twenty-ui-deprecated/input';
import { Section } from 'twenty-ui-deprecated/layout';
import { themeCssVariables } from 'twenty-ui-deprecated/theme-constants';
import { NotFound } from '~/pages/not-found/NotFound';
+import { getColorByEmailingDomainStatus } from '~/pages/settings/emailing-domains/utils/getEmailingDomainStatusColor';
+import { getTextByEmailingDomainStatus } from '~/pages/settings/emailing-domains/utils/getEmailingDomainStatusText';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
const DELETE_EMAIL_GROUP_MODAL_ID = 'delete-email-group-channel-modal';
-const StyledLoadingContainer = styled.div`
- align-items: center;
- display: flex;
- height: 200px;
- justify-content: center;
-`;
-
const StyledForwardingRow = styled.div`
display: flex;
flex-direction: row;
@@ -51,13 +56,10 @@ export const SettingsWorkspaceEmailGroupChannelDetail = () => {
const { enqueueErrorSnackBar } = useSnackBar();
const { deleteEmailGroupChannel, loading: deleting } =
useDeleteEmailGroupChannel();
+ const { data: emailingDomainsData } = useQuery(GetEmailingDomainsDocument);
if (loading) {
- return (
- <StyledLoadingContainer>
- <Loader />
- </StyledLoadingContainer>
- );
+ return <SettingsSkeletonLoader />;
}
const channel = channels.find(
@@ -73,13 +75,18 @@ export const SettingsWorkspaceEmailGroupChannelDetail = () => {
const sourceHandle = channel.connectedAccount.handle;
const forwardingAddress = channel.handle;
+ const channelDomain = getEmailChannelDomain(sourceHandle);
+ const emailingDomain = emailingDomainsData?.getEmailingDomains?.find(
+ (domain) => domain.domain.toLowerCase() === channelDomain,
+ );
+
const handleDelete = async () => {
try {
await deleteEmailGroupChannel(channel.id);
navigateSettings(SettingsPath.WorkspaceEmail);
} catch {
enqueueErrorSnackBar({
- message: t`Failed to delete email handle.`,
+ message: t`Failed to delete email channel.`,
});
}
};
@@ -111,6 +118,28 @@ export const SettingsWorkspaceEmailGroupChannelDetail = () => {
}
>
<SettingsPageContainer>
+ {isDefined(emailingDomain) && (
+ <Section>
+ <H2Title
+ title={t`Sending domain`}
+ description={t`Outbound mail from this channel is sent through this domain. It must be verified before email can be delivered.`}
+ adornment={
+ <SettingsEmailingDomainVerifyButton
+ emailingDomainId={emailingDomain.id}
+ />
+ }
+ />
+ <Status
+ color={getColorByEmailingDomainStatus(emailingDomain.status)}
+ text={getTextByEmailingDomainStatus(emailingDomain.status)}
+ />
+ {isDefined(emailingDomain.verificationRecords) && (
+ <SettingsDnsRecordsTable
+ records={emailingDomain.verificationRecords}
+ />
+ )}
+ </Section>
+ )}
<Section>
<H2Title
title={t`Source address`}
@@ -153,7 +182,7 @@ export const SettingsWorkspaceEmailGroupChannelDetail = () => {
</SettingsPageContainer>
<ConfirmationModal
modalInstanceId={DELETE_EMAIL_GROUP_MODAL_ID}
- title={t`Delete email handle`}
+ title={t`Delete email channel`}
subtitle={t`Are you sure you want to delete ${sourceHandle}? Inbound mail forwarded to this address and outbound replies from it will stop working.`}
onConfirmClick={handleDelete}
confirmButtonText={t`Delete`}
diff --git a/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceNewUnsubscribeTopic.tsx b/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceNewUnsubscribeTopic.tsx
new file mode 100644
index 00000000000..a7b71b137c8
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceNewUnsubscribeTopic.tsx
@@ -0,0 +1,144 @@
+import { useLingui } from '@lingui/react/macro';
+import { useCallback, useState } from 'react';
+
+import { useCreateUnsubscribeTopic } from '@/settings/unsubscribe-topics/hooks/useCreateUnsubscribeTopic';
+import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
+import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons';
+import { SettingsOptionCardContentToggle } from '@/settings/components/SettingsOptions/SettingsOptionCardContentToggle';
+import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
+import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
+import { FeatureFlagKey, SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath } from 'twenty-shared/utils';
+import { UnsubscribeTopicVisibility } from '~/generated-metadata/graphql';
+import { H2Title, IconEye } from 'twenty-ui-deprecated/display';
+import { Card, Section } from 'twenty-ui-deprecated/layout';
+import { NotFound } from '~/pages/not-found/NotFound';
+import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+
+export const SettingsWorkspaceNewUnsubscribeTopic = () => {
+ const { t } = useLingui();
+ const navigate = useNavigateSettings();
+ const { enqueueErrorSnackBar } = useSnackBar();
+ const { createUnsubscribeTopic, loading } = useCreateUnsubscribeTopic();
+ const isEmailGroupEnabled = useIsFeatureEnabled(
+ FeatureFlagKey.IS_EMAIL_GROUP_ENABLED,
+ );
+
+ const [name, setName] = useState('');
+ const [description, setDescription] = useState('');
+ const [isPublic, setIsPublic] = useState(false);
+
+ const canSave = name.length > 0 && !loading;
+
+ const handleSave = useCallback(async () => {
+ try {
+ const result = await createUnsubscribeTopic({
+ name,
+ description: description || null,
+ visibility: isPublic
+ ? UnsubscribeTopicVisibility.PUBLIC
+ : UnsubscribeTopicVisibility.PRIVATE,
+ });
+ const unsubscribeTopicId = result.data?.createUnsubscribeTopic.id;
+
+ if (unsubscribeTopicId) {
+ navigate(SettingsPath.UnsubscribeTopicDetail, {
+ unsubscribeTopicId,
+ });
+ } else {
+ navigate(SettingsPath.WorkspaceEmail);
+ }
+ } catch {
+ enqueueErrorSnackBar({
+ message: t`Failed to create unsubscribe topic.`,
+ });
+ }
+ }, [
+ createUnsubscribeTopic,
+ name,
+ description,
+ isPublic,
+ navigate,
+ enqueueErrorSnackBar,
+ t,
+ ]);
+
+ if (!isEmailGroupEnabled) {
+ return <NotFound />;
+ }
+
+ return (
+ <SettingsPageLayout
+ title={t`New Unsubscribe Topic`}
+ links={[
+ {
+ children: t`Workspace`,
+ href: getSettingsPath(SettingsPath.General),
+ },
+ {
+ children: t`Email`,
+ href: getSettingsPath(SettingsPath.WorkspaceEmail),
+ },
+ { children: t`New Unsubscribe Topic` },
+ ]}
+ actionButton={
+ <SaveAndCancelButtons
+ isSaveDisabled={!canSave}
+ isCancelDisabled={loading}
+ isLoading={loading}
+ onCancel={() => navigate(SettingsPath.WorkspaceEmail)}
+ onSave={handleSave}
+ />
+ }
+ >
+ <SettingsPageContainer>
+ <Section>
+ <H2Title
+ title={t`Name`}
+ description={t`The name recipients see for this topic.`}
+ />
+ <SettingsTextInput
+ instanceId="unsubscribe-topic-name"
+ label={t`Name`}
+ placeholder={t`Newsletters`}
+ value={name}
+ onChange={setName}
+ disabled={loading}
+ fullWidth
+ />
+ </Section>
+ <Section>
+ <H2Title
+ title={t`Description`}
+ description={t`Optional context shown to recipients on the preferences page.`}
+ />
+ <SettingsTextInput
+ instanceId="unsubscribe-topic-description"
+ label={t`Description`}
+ value={description}
+ onChange={setDescription}
+ disabled={loading}
+ fullWidth
+ />
+ </Section>
+ <Section>
+ <H2Title
+ title={t`Visibility`}
+ description={t`Control whether recipients can find and manage this topic.`}
+ />
+ <Card rounded>
+ <SettingsOptionCardContentToggle
+ Icon={IconEye}
+ title={t`Listed on the unsubscribe page`}
+ description={t`Public topics appear on the recipient preferences page.`}
+ checked={isPublic}
+ onChange={setIsPublic}
+ />
+ </Card>
+ </Section>
+ </SettingsPageContainer>
+ </SettingsPageLayout>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceUnsubscribeTopicDetail.tsx b/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceUnsubscribeTopicDetail.tsx
new file mode 100644
index 00000000000..9b5c5038266
--- /dev/null
+++ b/packages/twenty-front/src/pages/settings/email/SettingsWorkspaceUnsubscribeTopicDetail.tsx
@@ -0,0 +1,197 @@
+import { useLingui } from '@lingui/react/macro';
+import { useEffect, useState } from 'react';
+import { useParams } from 'react-router-dom';
+
+import { useUnsubscribeTopics } from '@/activities/emails/hooks/useUnsubscribeTopics';
+import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
+import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
+import { SettingsSkeletonLoader } from '@/settings/components/SettingsSkeletonLoader';
+import { SettingsOptionCardContentToggle } from '@/settings/components/SettingsOptions/SettingsOptionCardContentToggle';
+import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
+import { useDeleteUnsubscribeTopic } from '@/settings/unsubscribe-topics/hooks/useDeleteUnsubscribeTopic';
+import { useUpdateUnsubscribeTopic } from '@/settings/unsubscribe-topics/hooks/useUpdateUnsubscribeTopic';
+import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
+import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
+import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
+import { useModal } from '@/ui/layout/modal/hooks/useModal';
+import { FeatureFlagKey, SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath, isDefined } from 'twenty-shared/utils';
+import { UnsubscribeTopicVisibility } from '~/generated-metadata/graphql';
+import { H2Title, IconEye, IconTrash } from 'twenty-ui-deprecated/display';
+import { Button } from 'twenty-ui-deprecated/input';
+import { Card, Section } from 'twenty-ui-deprecated/layout';
+import { NotFound } from '~/pages/not-found/NotFound';
+import { useNavigateSettings } from '~/hooks/useNavigateSettings';
+
+const DELETE_UNSUBSCRIBE_TOPIC_MODAL_ID = 'delete-unsubscribe-topic-modal';
+
+export const SettingsWorkspaceUnsubscribeTopicDetail = () => {
+ const { t } = useLingui();
+ const navigateSettings = useNavigateSettings();
+ const { unsubscribeTopicId } = useParams<{ unsubscribeTopicId: string }>();
+ const { unsubscribeTopics, loading } = useUnsubscribeTopics();
+ const { openModal } = useModal();
+ const { enqueueErrorSnackBar } = useSnackBar();
+ const { updateUnsubscribeTopic } = useUpdateUnsubscribeTopic();
+ const { deleteUnsubscribeTopic, loading: deleting } =
+ useDeleteUnsubscribeTopic();
+ const isEmailGroupEnabled = useIsFeatureEnabled(
+ FeatureFlagKey.IS_EMAIL_GROUP_ENABLED,
+ );
+
+ const unsubscribeTopic = unsubscribeTopics.find(
+ (topic) => topic.id === unsubscribeTopicId,
+ );
+
+ const [name, setName] = useState('');
+ const [description, setDescription] = useState('');
+ const [seededTopicId, setSeededTopicId] = useState<string | null>(null);
+
+ useEffect(() => {
+ if (isDefined(unsubscribeTopic) && seededTopicId !== unsubscribeTopic.id) {
+ setSeededTopicId(unsubscribeTopic.id);
+ setName(unsubscribeTopic.name ?? '');
+ setDescription(unsubscribeTopic.description ?? '');
+ }
+ }, [unsubscribeTopic, seededTopicId]);
+
+ if (loading) {
+ return <SettingsSkeletonLoader />;
+ }
+
+ if (!isEmailGroupEnabled || !isDefined(unsubscribeTopic)) {
+ return <NotFound />;
+ }
+
+ const isPublic =
+ unsubscribeTopic.visibility === UnsubscribeTopicVisibility.PUBLIC;
+
+ const persist = async (
+ input: Parameters<typeof updateUnsubscribeTopic>[0],
+ ) => {
+ try {
+ await updateUnsubscribeTopic(input);
+ } catch {
+ enqueueErrorSnackBar({
+ message: t`Failed to update unsubscribe topic.`,
+ });
+ }
+ };
+
+ const handleNameBlur = () => {
+ if (name !== (unsubscribeTopic.name ?? '')) {
+ persist({ id: unsubscribeTopic.id, name });
+ }
+ };
+
+ const handleDescriptionBlur = () => {
+ if (description !== (unsubscribeTopic.description ?? '')) {
+ persist({ id: unsubscribeTopic.id, description: description || null });
+ }
+ };
+
+ const handleVisibilityChange = (checked: boolean) => {
+ persist({
+ id: unsubscribeTopic.id,
+ visibility: checked
+ ? UnsubscribeTopicVisibility.PUBLIC
+ : UnsubscribeTopicVisibility.PRIVATE,
+ });
+ };
+
+ const handleDelete = async () => {
+ try {
+ await deleteUnsubscribeTopic(unsubscribeTopic.id);
+ navigateSettings(SettingsPath.WorkspaceEmail);
+ } catch {
+ enqueueErrorSnackBar({
+ message: t`Failed to delete unsubscribe topic.`,
+ });
+ }
+ };
+
+ const topicName = unsubscribeTopic.name ?? t`Untitled topic`;
+
+ return (
+ <SettingsPageLayout
+ title={topicName}
+ links={[
+ {
+ children: t`Workspace`,
+ href: getSettingsPath(SettingsPath.General),
+ },
+ {
+ children: t`Email`,
+ href: getSettingsPath(SettingsPath.WorkspaceEmail),
+ },
+ { children: topicName },
+ ]}
+ actionButton={
+ <Button
+ Icon={IconTrash}
+ title={t`Delete`}
+ variant="secondary"
+ accent="danger"
+ size="small"
+ disabled={deleting}
+ onClick={() => openModal(DELETE_UNSUBSCRIBE_TOPIC_MODAL_ID)}
+ />
+ }
+ >
+ <SettingsPageContainer>
+ <Section>
+ <H2Title
+ title={t`Name`}
+ description={t`The name recipients see for this topic.`}
+ />
+ <SettingsTextInput
+ instanceId="unsubscribe-topic-name"
+ label={t`Name`}
+ value={name}
+ onChange={setName}
+ onBlur={handleNameBlur}
+ fullWidth
+ />
+ </Section>
+ <Section>
+ <H2Title
+ title={t`Description`}
+ description={t`Optional context shown to recipients on the preferences page.`}
+ />
+ <SettingsTextInput
+ instanceId="unsubscribe-topic-description"
+ label={t`Description`}
+ value={description}
+ onChange={setDescription}
+ onBlur={handleDescriptionBlur}
+ fullWidth
+ />
+ </Section>
+ <Section>
+ <H2Title
+ title={t`Visibility`}
+ description={t`Control whether recipients can find and manage this topic.`}
+ />
+ <Card rounded>
+ <SettingsOptionCardContentToggle
+ Icon={IconEye}
+ title={t`Listed on the unsubscribe page`}
+ description={t`Public topics appear on the recipient preferences page.`}
+ checked={isPublic}
+ onChange={handleVisibilityChange}
+ />
+ </Card>
+ </Section>
+ </SettingsPageContainer>
+ <ConfirmationModal
+ modalInstanceId={DELETE_UNSUBSCRIBE_TOPIC_MODAL_ID}
+ title={t`Delete unsubscribe topic`}
+ subtitle={t`Are you sure you want to delete ${topicName}? Recipients will no longer be able to opt out of this category.`}
+ onConfirmClick={handleDelete}
+ confirmButtonText={t`Delete`}
+ confirmButtonAccent="danger"
+ loading={deleting}
+ />
+ </SettingsPageLayout>
+ );
+};
diff --git a/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx b/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
deleted file mode 100644
index dfd99ff1171..00000000000
--- a/packages/twenty-front/src/pages/settings/emailing-domains/SettingsEmailingDomainDetail.tsx
+++ /dev/null
@@ -1,122 +0,0 @@
-import { useMutation, useQuery } from '@apollo/client/react';
-import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { Trans, useLingui } from '@lingui/react/macro';
-import { useParams } from 'react-router-dom';
-
-import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
-import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
-import { SettingsEmailingDomainVerificationRecords } from '@/settings/emailing-domains/components/SettingsEmailingDomainVerificationRecords';
-import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
-import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
-import { useModal } from '@/ui/layout/modal/hooks/useModal';
-import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
-import { SettingsPath } from 'twenty-shared/types';
-import { getSettingsPath, isDefined } from 'twenty-shared/utils';
-import { IconTrash } from 'twenty-ui-deprecated/display';
-import { Button } from 'twenty-ui-deprecated/input';
-import {
- DeleteEmailingDomainDocument,
- type GetEmailingDomainsQuery,
- GetEmailingDomainsDocument,
-} from '~/generated-metadata/graphql';
-import { useNavigateSettings } from '~/hooks/useNavigateSettings';
-
-const DELETE_EMAILING_DOMAIN_MODAL_ID = 'delete-emailing-domain-modal';
-
-export const SettingsEmailingDomainDetail = () => {
- const { t } = useLingui();
- const navigateSettings = useNavigateSettings();
- const { domainId } = useParams<{ domainId: string }>();
-
- const { data, loading, error } = useQuery<GetEmailingDomainsQuery>(
- GetEmailingDomainsDocument,
- {
- skip: !domainId,
- },
- );
-
- const { openModal } = useModal();
- const { enqueueErrorSnackBar, enqueueSuccessSnackBar } = useSnackBar();
- const [deleteEmailingDomain, { loading: deleting }] = useMutation(
- DeleteEmailingDomainDocument,
- { refetchQueries: [GetEmailingDomainsDocument] },
- );
-
- const emailingDomain = data?.getEmailingDomains?.find(
- (domain) => domain.id === domainId,
- );
-
- if (loading) {
- return <SettingsEmptyPlaceholder>{t`Loading...`}</SettingsEmptyPlaceholder>;
- }
-
- if (isDefined(error) || !isDefined(emailingDomain)) {
- return (
- <SettingsEmptyPlaceholder>
- <Trans>Domain not found</Trans>
- </SettingsEmptyPlaceholder>
- );
- }
-
- const handleDelete = async () => {
- try {
- await deleteEmailingDomain({ variables: { id: emailingDomain.id } });
- enqueueSuccessSnackBar({
- message: t`Emailing domain deleted successfully`,
- });
- navigateSettings(SettingsPath.WorkspaceEmail);
- } catch (deleteError) {
- enqueueErrorSnackBar({
- ...(CombinedGraphQLErrors.is(deleteError)
- ? { apolloError: deleteError }
- : {}),
- });
- }
- };
-
- return (
- <SettingsPageLayout
- title={emailingDomain.domain}
- links={[
- {
- children: <Trans>Workspace</Trans>,
- href: getSettingsPath(SettingsPath.General),
- },
- {
- children: <Trans>Email</Trans>,
- href: getSettingsPath(SettingsPath.WorkspaceEmail),
- },
- { children: emailingDomain.domain },
- ]}
- actionButton={
- <Button
- Icon={IconTrash}
- title={t`Delete`}
- variant="secondary"
- accent="danger"
- size="small"
- disabled={deleting}
- onClick={() => openModal(DELETE_EMAILING_DOMAIN_MODAL_ID)}
- />
- }
- >
- <SettingsPageContainer>
- {emailingDomain.verificationRecords &&
- emailingDomain.verificationRecords.length > 0 && (
- <SettingsEmailingDomainVerificationRecords
- domain={emailingDomain}
- />
- )}
- </SettingsPageContainer>
- <ConfirmationModal
- modalInstanceId={DELETE_EMAILING_DOMAIN_MODAL_ID}
- title={t`Delete emailing domain`}
- subtitle={t`Are you sure you want to delete ${emailingDomain.domain}? Outbound mail through this domain will stop working.`}
- onConfirmClick={handleDelete}
- confirmButtonText={t`Delete`}
- confirmButtonAccent="danger"
- loading={deleting}
- />
- </SettingsPageLayout>
- );
-};
diff --git a/packages/twenty-front/src/pages/settings/emailing-domains/SettingsNewEmailingDomain.tsx b/packages/twenty-front/src/pages/settings/emailing-domains/SettingsNewEmailingDomain.tsx
deleted file mode 100644
index 9c7c2886298..00000000000
--- a/packages/twenty-front/src/pages/settings/emailing-domains/SettingsNewEmailingDomain.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-import { SaveAndCancelButtons } from '@/settings/components/SaveAndCancelButtons/SaveAndCancelButtons';
-import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
-import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
-import { SettingsTextInput } from '@/ui/input/components/SettingsTextInput';
-import { SettingsPageLayout } from '@/settings/components/layout/SettingsPageLayout';
-import { CombinedGraphQLErrors } from '@apollo/client/errors';
-import { Trans, useLingui } from '@lingui/react/macro';
-import { useState } from 'react';
-import { SettingsPath } from 'twenty-shared/types';
-import { getSettingsPath, isDefined } from 'twenty-shared/utils';
-import { H2Title } from 'twenty-ui-deprecated/display';
-import { Section } from 'twenty-ui-deprecated/layout';
-import { useMutation } from '@apollo/client/react';
-import { CreateEmailingDomainDocument } from '~/generated-metadata/graphql';
-import { useNavigateSettings } from '~/hooks/useNavigateSettings';
-import {
- settingsEmailingDomainFormSchema,
- type SettingsEmailingDomainFormValues,
-} from '~/pages/settings/emailing-domains/validation-schemas/settingsEmailingDomainFormSchema';
-
-type FieldErrors = Partial<
- Record<keyof SettingsEmailingDomainFormValues, string>
->;
-export const SettingsNewEmailingDomain = () => {
- const navigate = useNavigateSettings();
- const { t } = useLingui();
- const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();
-
- const [formValues, setFormValues] =
- useState<SettingsEmailingDomainFormValues>({
- domain: '',
- });
-
- const [fieldErrors, setFieldErrors] = useState<FieldErrors>({});
- const [isSubmitting, setIsSubmitting] = useState(false);
-
- const [createEmailingDomain] = useMutation(CreateEmailingDomainDocument);
-
- const validateForm = (): boolean => {
- const result = settingsEmailingDomainFormSchema.safeParse(formValues);
-
- if (!result.success) {
- setFieldErrors(result.error?.flatten().fieldErrors as FieldErrors);
- return false;
- }
-
- setFieldErrors({});
- return true;
- };
-
- const handleFieldChange = (
- field: keyof SettingsEmailingDomainFormValues,
- value: string,
- ) => {
- setFormValues((prev) => ({
- ...prev,
- [field]: value,
- }));
-
- if (isDefined(fieldErrors[field])) {
- setFieldErrors((prev) => ({
- ...prev,
- [field]: undefined,
- }));
- }
- };
-
- const canSave = !isSubmitting;
-
- const handleSave = async () => {
- if (!validateForm()) {
- return;
- }
-
- setIsSubmitting(true);
-
- try {
- await createEmailingDomain({
- variables: {
- domain: formValues.domain,
- },
- onCompleted: (data) => {
- enqueueSuccessSnackBar({
- message: t`Emailing domain created successfully. Please verify the domain to start using it.`,
- });
- if (!data.createEmailingDomain?.id) return;
-
- navigate(SettingsPath.EmailingDomainDetail, {
- domainId: data.createEmailingDomain.id,
- });
- },
- onError: (error) => {
- enqueueErrorSnackBar({
- apolloError: CombinedGraphQLErrors.is(error) ? error : undefined,
- });
- },
- });
- } catch (error) {
- enqueueErrorSnackBar({
- apolloError: CombinedGraphQLErrors.is(error) ? error : undefined,
- });
- } finally {
- setIsSubmitting(false);
- }
- };
-
- return (
- <SettingsPageLayout
- title={t`New Emailing Domain`}
- actionButton={
- <SaveAndCancelButtons
- onCancel={() => navigate(SettingsPath.WorkspaceEmail)}
- onSave={handleSave}
- isSaveDisabled={!canSave}
- />
- }
- links={[
- {
- children: <Trans>Workspace</Trans>,
- href: getSettingsPath(SettingsPath.General),
- },
- {
- children: <Trans>Email</Trans>,
- href: getSettingsPath(SettingsPath.WorkspaceEmail),
- },
- { children: <Trans>New Emailing Domain</Trans> },
- ]}
- >
- <SettingsPageContainer>
- <Section>
- <H2Title
- title={t`Domain`}
- description={t`The domain name you want to use for emailing`}
- />
- <SettingsTextInput
- instanceId="emailing-domain"
- autoFocus
- autoComplete="off"
- value={formValues.domain}
- onChange={(value) => handleFieldChange('domain', value)}
- fullWidth
- placeholder="yourdomain.com"
- error={fieldErrors.domain}
- />
- </Section>
- </SettingsPageContainer>
- </SettingsPageLayout>
- );
-};
diff --git a/packages/twenty-front/src/testing/mock-data/config.ts b/packages/twenty-front/src/testing/mock-data/config.ts
index 04f4e3d3465..46327ede867 100644
--- a/packages/twenty-front/src/testing/mock-data/config.ts
+++ b/packages/twenty-front/src/testing/mock-data/config.ts
@@ -53,9 +53,8 @@ export const mockedClientConfig: ClientConfig = {
isAttachmentPreviewEnabled: true,
isConfigVariablesInDbEnabled: false,
isImapSmtpCaldavEnabled: false,
- isEmailGroupEnabled: false,
isTwoFactorAuthenticationEnabled: false,
- isEmailingDomainsEnabled: false,
+ isEmailingDomainInDemoMode: false,
allowRequestsToTwentyIcons: true,
isCloudflareIntegrationEnabled: false,
isClickHouseConfigured: false,
diff --git a/packages/twenty-server/src/database/commands/list-and-delete-orphaned-workspace-entities.command.ts b/packages/twenty-server/src/database/commands/list-and-delete-orphaned-workspace-entities.command.ts
index f37a7416c13..a6a81a4463c 100644
--- a/packages/twenty-server/src/database/commands/list-and-delete-orphaned-workspace-entities.command.ts
+++ b/packages/twenty-server/src/database/commands/list-and-delete-orphaned-workspace-entities.command.ts
@@ -15,6 +15,7 @@ import { BillingCustomerEntity } from 'src/engine/core-modules/billing/entities/
import { BillingEntitlementEntity } from 'src/engine/core-modules/billing/entities/billing-entitlement.entity';
import { BillingSubscriptionEntity } from 'src/engine/core-modules/billing/entities/billing-subscription.entity';
import { EmailingDomainEntity } from 'src/engine/core-modules/emailing-domain/emailing-domain.entity';
+import { MessageSuppressionEntity } from 'src/engine/core-modules/emailing-domain/message-suppression.entity';
import { FeatureFlagEntity } from 'src/engine/core-modules/feature-flag/feature-flag.entity';
import { FileEntity } from 'src/engine/core-modules/file/entities/file.entity';
import { PublicDomainEntity } from 'src/engine/core-modules/public-domain/public-domain.entity';
@@ -102,6 +103,7 @@ const WORKSPACE_RELATED_ENTITIES: EntityTarget<ObjectLiteral>[] = [
BillingSubscriptionEntity,
DataSourceEntity,
EmailingDomainEntity,
+ MessageSuppressionEntity,
FeatureFlagEntity,
FileEntity,
PublicDomainEntity,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1780088214774-add-emailing-domain-unsubscribe-host.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1780088214774-add-emailing-domain-unsubscribe-host.ts
new file mode 100644
index 00000000000..bf5fc16bcc1
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1780088214774-add-emailing-domain-unsubscribe-host.ts
@@ -0,0 +1,21 @@
+import { QueryRunner } from 'typeorm';
+
+import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-instance-command.decorator';
+import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
+
+@RegisteredInstanceCommand('2.13.0', 1780088214774)
+export class AddEmailingDomainUnsubscribeHostFastInstanceCommand implements FastInstanceCommand {
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query('ALTER TABLE "core"."emailingDomain" ADD COLUMN IF NOT EXISTS "unsubscribeHostname" character varying');
+ await queryRunner.query('ALTER TABLE "core"."emailingDomain" ADD COLUMN IF NOT EXISTS "unsubscribeHostnameId" character varying');
+ await queryRunner.query('DO $$ BEGIN CREATE TYPE "core"."emailingDomain_unsubscribehostnamestatus_enum" AS ENUM(\'PENDING\', \'ACTIVE\', \'FAILED\'); EXCEPTION WHEN duplicate_object THEN null; END $$');
+ await queryRunner.query('ALTER TABLE "core"."emailingDomain" ADD COLUMN IF NOT EXISTS "unsubscribeHostnameStatus" "core"."emailingDomain_unsubscribehostnamestatus_enum"');
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query('ALTER TABLE "core"."emailingDomain" DROP COLUMN IF EXISTS "unsubscribeHostnameStatus"');
+ await queryRunner.query('DROP TYPE IF EXISTS "core"."emailingDomain_unsubscribehostnamestatus_enum"');
+ await queryRunner.query('ALTER TABLE "core"."emailingDomain" DROP COLUMN IF EXISTS "unsubscribeHostnameId"');
+ await queryRunner.query('ALTER TABLE "core"."emailingDomain" DROP COLUMN IF EXISTS "unsubscribeHostname"');
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1781250000000-create-message-suppression-core-table.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1781250000000-create-message-suppression-core-table.ts
new file mode 100644
index 00000000000..6e9ad94b427
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1781250000000-create-message-suppression-core-table.ts
@@ -0,0 +1,55 @@
+import { QueryRunner } from 'typeorm';
+
+import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-instance-command.decorator';
+import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
+
+@RegisteredInstanceCommand('2.13.0', 1781250000000)
+export class CreateMessageSuppressionCoreTableFastInstanceCommand implements FastInstanceCommand {
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `DO $$ BEGIN CREATE TYPE "core"."messageSuppression_reason_enum" AS ENUM ('BOUNCE', 'COMPLAINT', 'UNSUBSCRIBE'); EXCEPTION WHEN duplicate_object THEN null; END $$`,
+ );
+ await queryRunner.query(
+ `DO $$ BEGIN CREATE TYPE "core"."messageSuppression_source_enum" AS ENUM ('WEBHOOK', 'SYSTEM'); EXCEPTION WHEN duplicate_object THEN null; END $$`,
+ );
+ await queryRunner.query(
+ `CREATE TABLE IF NOT EXISTS "core"."messageSuppression" (
+ "id" uuid NOT NULL DEFAULT uuid_generate_v4(),
+ "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
+ "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
+ "emailAddress" character varying NOT NULL,
+ "reason" "core"."messageSuppression_reason_enum" NOT NULL,
+ "source" "core"."messageSuppression_source_enum" NOT NULL,
+ "providerEventId" character varying,
+ "unsubscribeTopicId" uuid,
+ "workspaceId" uuid NOT NULL,
+ CONSTRAINT "PK_messageSuppression_id" PRIMARY KEY ("id"),
+ CONSTRAINT "FK_6eba121ed8e57afaa1f052cb685" FOREIGN KEY ("workspaceId") REFERENCES "core"."workspace"("id") ON DELETE CASCADE
+ )`,
+ );
+ await queryRunner.query(
+ `CREATE UNIQUE INDEX IF NOT EXISTS "IDX_MESSAGE_SUPPRESSION_GLOBAL_UNIQUE"
+ ON "core"."messageSuppression" ("workspaceId", "emailAddress")
+ WHERE "unsubscribeTopicId" IS NULL`,
+ );
+ await queryRunner.query(
+ `CREATE UNIQUE INDEX IF NOT EXISTS "IDX_MESSAGE_SUPPRESSION_TOPIC_UNIQUE"
+ ON "core"."messageSuppression" ("workspaceId", "emailAddress", "unsubscribeTopicId")
+ WHERE "unsubscribeTopicId" IS NOT NULL`,
+ );
+ await queryRunner.query(
+ `CREATE INDEX IF NOT EXISTS "IDX_MESSAGE_SUPPRESSION_WORKSPACE_ID"
+ ON "core"."messageSuppression" ("workspaceId")`,
+ );
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`DROP TABLE IF EXISTS "core"."messageSuppression"`);
+ await queryRunner.query(
+ `DROP TYPE IF EXISTS "core"."messageSuppression_reason_enum"`,
+ );
+ await queryRunner.query(
+ `DROP TYPE IF EXISTS "core"."messageSuppression_source_enum"`,
+ );
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1781260000000-create-unsubscribe-topic-core-table.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1781260000000-create-unsubscribe-topic-core-table.ts
new file mode 100644
index 00000000000..abf03022ddb
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1781260000000-create-unsubscribe-topic-core-table.ts
@@ -0,0 +1,38 @@
+import { QueryRunner } from 'typeorm';
+
+import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-instance-command.decorator';
+import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
+
+@RegisteredInstanceCommand('2.13.0', 1781260000000)
+export class CreateUnsubscribeTopicCoreTableFastInstanceCommand implements FastInstanceCommand {
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(
+ `DO $$ BEGIN CREATE TYPE "core"."unsubscribeTopic_visibility_enum" AS ENUM ('PUBLIC', 'PRIVATE'); EXCEPTION WHEN duplicate_object THEN null; END $$`,
+ );
+ await queryRunner.query(
+ `CREATE TABLE IF NOT EXISTS "core"."unsubscribeTopic" (
+ "id" uuid NOT NULL DEFAULT uuid_generate_v4(),
+ "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
+ "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
+ "name" character varying,
+ "description" character varying,
+ "visibility" "core"."unsubscribeTopic_visibility_enum" NOT NULL DEFAULT 'PRIVATE',
+ "workspaceId" uuid NOT NULL,
+ CONSTRAINT "PK_unsubscribeTopic_id" PRIMARY KEY ("id"),
+ -- FK name must match TypeORM's generated hash for WorkspaceRelatedEntity.workspace (schema drift otherwise).
+ CONSTRAINT "FK_16d7bf6f90fac4745c89e1e8d56" FOREIGN KEY ("workspaceId") REFERENCES "core"."workspace"("id") ON DELETE CASCADE
+ )`,
+ );
+ await queryRunner.query(
+ `CREATE INDEX IF NOT EXISTS "IDX_UNSUBSCRIBE_TOPIC_WORKSPACE_ID"
+ ON "core"."unsubscribeTopic" ("workspaceId")`,
+ );
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query(`DROP TABLE IF EXISTS "core"."unsubscribeTopic"`);
+ await queryRunner.query(
+ `DROP TYPE IF EXISTS "core"."unsubscribeTopic_visibility_enum"`,
+ );
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
index 53ea2bfe344..1f3d4c736f8 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
@@ -62,6 +62,9 @@ import { MigrateAiModelPreferencesSlowInstanceCommand } from 'src/database/comma
import { DropIsCustomFromObjectAndFieldMetadataFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-12/2-12-instance-command-fast-1780579070012-drop-is-custom-from-object-and-field-metadata';
import { AddArchivedAtToConnectedAccountFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1781171103000-add-archived-at-to-connected-account';
import { DropEmailingDomainDriverColumnFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-11/2-11-instance-command-fast-1780926908000-drop-emailing-domain-driver-column';
+import { AddEmailingDomainUnsubscribeHostFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1780088214774-add-emailing-domain-unsubscribe-host';
+import { CreateMessageSuppressionCoreTableFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1781250000000-create-message-suppression-core-table';
+import { CreateUnsubscribeTopicCoreTableFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1781260000000-create-unsubscribe-topic-core-table';
import { ViewOverridableEntityFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-12/2-12-instance-command-fast-1781114009075-view-overridable-entity';
import { RenameIsUiReadOnlyToIsUiEditableFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-13/2-13-instance-command-fast-1781277453604-rename-is-ui-read-only-to-is-ui-editable';
import { BackfillNonUiCreatableStandardSystemObjectsSlowInstanceCommand } from 'src/database/commands/upgrade-version-command/2-13/2-13-instance-command-slow-1781277480000-backfill-non-ui-creatable-standard-system-objects';
@@ -129,7 +132,10 @@ export const INSTANCE_COMMANDS = [
EncryptNonSecretApplicationVariableSlowInstanceCommand,
DropIsCustomFromObjectAndFieldMetadataFastInstanceCommand,
DropEmailingDomainDriverColumnFastInstanceCommand,
+ AddEmailingDomainUnsubscribeHostFastInstanceCommand,
ViewOverridableEntityFastInstanceCommand,
+ CreateMessageSuppressionCoreTableFastInstanceCommand,
+ CreateUnsubscribeTopicCoreTableFastInstanceCommand,
AddArchivedAtToConnectedAccountFastInstanceCommand,
RenameIsUiReadOnlyToIsUiEditableFastInstanceCommand,
BackfillNonUiCreatableStandardSystemObjectsSlowInstanceCommand,
diff --git a/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.service.ts b/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.service.ts
index c197452acb1..fee98531099 100644
--- a/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/approved-access-domain/services/approved-access-domain.service.ts
@@ -27,6 +27,7 @@ import { isAsymmetricJwtHeader } from 'src/engine/core-modules/jwt/utils/is-asym
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
import { WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
import { isWorkDomain } from 'src/utils/is-work-email';
const APPROVED_ACCESS_DOMAIN_TOKEN_EXPIRES_IN = '7d';
@@ -65,7 +66,7 @@ export class ApprovedAccessDomainService {
);
}
- if (to.split('@')[1] !== approvedAccessDomain.domain) {
+ if (getDomainFromEmail(to) !== approvedAccessDomain.domain) {
throw new ApprovedAccessDomainException(
'Approved access domain does not match email domain',
ApprovedAccessDomainExceptionCode.APPROVED_ACCESS_DOMAIN_DOES_NOT_MATCH_DOMAIN_EMAIL,
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts
index dd10384a488..5bdd73ccffe 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/services/auth.service.ts
@@ -71,6 +71,7 @@ import { AuthProviderEnum } from 'src/engine/core-modules/workspace/types/worksp
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
import { workspaceValidator } from 'src/engine/core-modules/workspace/workspace.validate';
import { PermissionsService } from 'src/engine/metadata-modules/permissions/permissions.service';
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
// import { DEFAULT_FEATURE_FLAGS } from 'src/engine/workspace-manager/workspace-migration/constant/default-feature-flags';
@Injectable()
@@ -896,7 +897,8 @@ export class AuthService {
if (
workspace?.approvedAccessDomains.some(
(trustDomain) =>
- trustDomain.isValidated && trustDomain.domain === email.split('@')[1],
+ trustDomain.isValidated &&
+ trustDomain.domain === getDomainFromEmail(email),
)
) {
return;
diff --git a/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts b/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
index dec20c0beb7..0023028ba4c 100644
--- a/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
@@ -47,7 +47,7 @@ import { AuthProviderEnum } from 'src/engine/core-modules/workspace/types/worksp
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
import { WorkspaceEventEmitter } from 'src/engine/workspace-event-emitter/workspace-event-emitter';
-import { getDomainNameByEmail } from 'src/utils/get-domain-name-by-email';
+import { getDomainFromEmailOrThrow } from 'src/utils/get-domain-from-email-or-throw';
import { isWorkEmail } from 'src/utils/is-work-email';
@Injectable()
@@ -542,7 +542,7 @@ export class SignInUpService {
);
if (isWorkEmailFound) {
- const logoUrl = `${TWENTY_ICONS_BASE_URL}/${getDomainNameByEmail(email)}`;
+ const logoUrl = `${TWENTY_ICONS_BASE_URL}/${getDomainFromEmailOrThrow(email)}`;
const logoFile =
await this.fileCorePictureService.uploadWorkspaceLogoFromUrl({
imageUrl: logoUrl,
diff --git a/packages/twenty-server/src/engine/core-modules/client-config/client-config.controller.spec.ts b/packages/twenty-server/src/engine/core-modules/client-config/client-config.controller.spec.ts
index 63036640dca..651d33c53fc 100644
--- a/packages/twenty-server/src/engine/core-modules/client-config/client-config.controller.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/client-config/client-config.controller.spec.ts
@@ -94,7 +94,7 @@ describe('ClientConfigController', () => {
isGoogleCalendarEnabled: false,
isConfigVariablesInDbEnabled: false,
isImapSmtpCaldavEnabled: false,
- isEmailGroupEnabled: false,
+ isEmailingDomainInDemoMode: false,
calendarBookingPageId: undefined,
isTwoFactorAuthenticationEnabled: false,
allowRequestsToTwentyIcons: true,
diff --git a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
index 37bfcd50d66..50d89805676 100644
--- a/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/client-config/client-config.entity.ts
@@ -310,7 +310,7 @@ export class ClientConfig {
isImapSmtpCaldavEnabled: boolean;
@Field(() => Boolean)
- isEmailGroupEnabled: boolean;
+ isEmailingDomainInDemoMode: boolean;
@Field(() => Boolean)
allowRequestsToTwentyIcons: boolean;
diff --git a/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.spec.ts b/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.spec.ts
index c404d141654..0e27d5dcc57 100644
--- a/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.spec.ts
@@ -171,7 +171,7 @@ describe('ClientConfigService', () => {
isGoogleCalendarEnabled: true,
isConfigVariablesInDbEnabled: false,
isImapSmtpCaldavEnabled: false,
- isEmailGroupEnabled: false,
+ isEmailingDomainInDemoMode: false,
allowRequestsToTwentyIcons: false,
calendarBookingPageId: 'team/twenty/talk-to-us',
isCloudflareIntegrationEnabled: false,
diff --git a/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.ts b/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.ts
index d945ccaed15..8a8155ac304 100644
--- a/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/client-config/services/client-config.service.ts
@@ -3,7 +3,6 @@ import { Injectable } from '@nestjs/common';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
-import { StorageDriverType } from 'src/engine/core-modules/file-storage/interfaces/file-storage.interface';
import { NodeEnvironment } from 'src/engine/core-modules/twenty-config/interfaces/node-environment.interface';
import { SupportDriver } from 'src/engine/core-modules/twenty-config/interfaces/support.interface';
@@ -13,6 +12,7 @@ import {
type ClientConfig,
} from 'src/engine/core-modules/client-config/client-config.entity';
import { DomainServerConfigService } from 'src/engine/core-modules/domain/domain-server-config/services/domain-server-config.service';
+import { EmailingDomainDriver } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-driver.type';
import { PUBLIC_FEATURE_FLAGS } from 'src/engine/core-modules/feature-flag/constants/public-feature-flag.const';
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
import {
@@ -46,6 +46,10 @@ export class ClientConfigService {
'CALENDAR_BOOKING_PAGE_ID',
);
+ const isEmailingDomainInDemoMode =
+ this.twentyConfigService.get('EMAILING_DOMAIN_DRIVER') ===
+ EmailingDomainDriver.LOG;
+
const availableModels =
this.aiModelRegistryService.getAdminFilteredModels();
const recommendedModelIds =
@@ -235,10 +239,7 @@ export class ClientConfigService {
isImapSmtpCaldavEnabled: this.twentyConfigService.get(
'IS_IMAP_SMTP_CALDAV_ENABLED',
),
- isEmailGroupEnabled:
- this.twentyConfigService.get('STORAGE_TYPE') ===
- StorageDriverType.S_3 &&
- isNonEmptyString(this.twentyConfigService.get('INBOUND_EMAIL_DOMAIN')),
+ isEmailingDomainInDemoMode,
allowRequestsToTwentyIcons: this.twentyConfigService.get(
'ALLOW_REQUESTS_TO_TWENTY_ICONS',
),
diff --git a/packages/twenty-server/src/engine/core-modules/core-engine.module.ts b/packages/twenty-server/src/engine/core-modules/core-engine.module.ts
index c6c41eaf50a..4734e9c303e 100644
--- a/packages/twenty-server/src/engine/core-modules/core-engine.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/core-engine.module.ts
@@ -29,6 +29,7 @@ import { CodeInterpreterModule } from 'src/engine/core-modules/code-interpreter/
import { DnsManagerModule } from 'src/engine/core-modules/dns-manager/dns-manager.module';
import { EmailModule } from 'src/engine/core-modules/email/email.module';
import { EmailingDomainModule } from 'src/engine/core-modules/emailing-domain/emailing-domain.module';
+import { EmailingModule } from 'src/modules/emailing/emailing.module';
import { EnvironmentModule } from 'src/engine/core-modules/environment/environment.module';
import { ExceptionHandlerModule } from 'src/engine/core-modules/exception-handler/exception-handler.module';
import { exceptionHandlerModuleFactory } from 'src/engine/core-modules/exception-handler/exception-handler.module-factory';
@@ -45,7 +46,7 @@ import { LogicFunctionModule } from 'src/engine/core-modules/logic-function/logi
import { MessageQueueModule } from 'src/engine/core-modules/message-queue/message-queue.module';
import { messageQueueModuleFactory } from 'src/engine/core-modules/message-queue/message-queue.module-factory';
import { TimelineMessagingModule } from 'src/engine/core-modules/messaging/timeline-messaging.module';
-import { MessagingWebhooksModule } from 'src/engine/core-modules/messaging-webhooks/messaging-webhooks.module';
+import { MessagingWebhooksModule } from 'src/modules/messaging-webhooks/messaging-webhooks.module';
import { MetricsModule } from 'src/engine/core-modules/metrics/metrics.module';
import { MetricsService } from 'src/engine/core-modules/metrics/metrics.service';
import { OpenApiModule } from 'src/engine/core-modules/open-api/open-api.module';
@@ -108,6 +109,7 @@ import { FileModule } from './file/file.module';
WorkspaceSSOModule,
ApprovedAccessDomainModule,
EmailingDomainModule,
+ EmailingModule,
PublicDomainModule,
CloudflareModule,
DnsManagerModule,
diff --git a/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/utils/get-subdomain-from-email.util.ts b/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/utils/get-subdomain-from-email.util.ts
index a9c2e586008..21f41179084 100644
--- a/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/utils/get-subdomain-from-email.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/domain/subdomain-manager/utils/get-subdomain-from-email.util.ts
@@ -1,12 +1,12 @@
import { isDefined } from 'twenty-shared/utils';
-import { getDomainNameByEmail } from 'src/utils/get-domain-name-by-email';
+import { getDomainFromEmailOrThrow } from 'src/utils/get-domain-from-email-or-throw';
import { isWorkEmail } from 'src/utils/is-work-email';
export const getSubdomainFromEmail = (email?: string) => {
if (!isDefined(email) || !isWorkEmail(email)) return;
- const domain = getDomainNameByEmail(email);
+ const domain = getDomainFromEmailOrThrow(email);
return domain.split('.')[0].toLowerCase();
};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/campaign.constant.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/campaign.constant.ts
new file mode 100644
index 00000000000..5b14bb915c6
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/campaign.constant.ts
@@ -0,0 +1,24 @@
+export const CAMPAIGN_MESSAGE_DELIVERY_STATUS = {
+ QUEUED: 'QUEUED',
+ SENT: 'SENT',
+ FAILED: 'FAILED',
+ BOUNCED: 'BOUNCED',
+ COMPLAINED: 'COMPLAINED',
+ SKIPPED: 'SKIPPED',
+} as const;
+
+export const CAMPAIGN_STATUS = {
+ DRAFT: 'DRAFT',
+ SCHEDULED: 'SCHEDULED',
+ SENDING: 'SENDING',
+ SENT: 'SENT',
+ SENT_WITH_ERRORS: 'SENT_WITH_ERRORS',
+} as const;
+
+export const MATERIALIZE_CAMPAIGN_JOB = 'MaterializeCampaignJob';
+export const SEND_CAMPAIGN_EMAIL_JOB = 'SendCampaignEmailJob';
+
+export const MAX_CAMPAIGN_RECIPIENTS = 10000;
+
+export const CAMPAIGN_MESSAGE_ID_NAMESPACE =
+ '0c4b9e7a-3f2d-4b6c-9e1a-7d8f5a2c3b4e';
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/empty-unsubscribe-content.constant.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/empty-unsubscribe-content.constant.ts
new file mode 100644
index 00000000000..bcf2ed618d7
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/empty-unsubscribe-content.constant.ts
@@ -0,0 +1,7 @@
+import { type UnsubscribeContent } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-content.type';
+
+export const EMPTY_UNSUBSCRIBE_CONTENT: UnsubscribeContent = {
+ headers: [],
+ textFooter: '',
+ htmlFooter: '',
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/hard-suppression-reasons.constant.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/hard-suppression-reasons.constant.ts
new file mode 100644
index 00000000000..deff940c158
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/hard-suppression-reasons.constant.ts
@@ -0,0 +1,11 @@
+import { MessageSuppressionReason } from 'src/engine/core-modules/emailing-domain/types/message-suppression-reason.type';
+
+export const HARD_SUPPRESSION_REASONS = [
+ MessageSuppressionReason.BOUNCE,
+ MessageSuppressionReason.COMPLAINT,
+];
+
+export const GLOBAL_BLOCKING_SUPPRESSION_REASONS = [
+ ...HARD_SUPPRESSION_REASONS,
+ MessageSuppressionReason.UNSUBSCRIBE,
+];
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/unsubscribe-hostname-prefix.constant.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/unsubscribe-hostname-prefix.constant.ts
new file mode 100644
index 00000000000..d3271cb82e4
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/unsubscribe-hostname-prefix.constant.ts
@@ -0,0 +1 @@
+export const UNSUBSCRIBE_HOSTNAME_PREFIX = 'unsubscribe';
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/unsubscribe-mailbox.constant.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/unsubscribe-mailbox.constant.ts
new file mode 100644
index 00000000000..209d4ecd00d
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/constants/unsubscribe-mailbox.constant.ts
@@ -0,0 +1 @@
+export const UNSUBSCRIBE_MAILBOX_LOCAL_PART = 'unsubscribe';
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/constants/aws-ses-marketing-topic-name.constant.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/constants/aws-ses-marketing-topic-name.constant.ts
deleted file mode 100644
index 02bd67108b9..00000000000
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/constants/aws-ses-marketing-topic-name.constant.ts
+++ /dev/null
@@ -1 +0,0 @@
-export const AWS_SES_MARKETING_TOPIC_NAME = 'marketing';
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/__tests__/aws-ses-register-domain.service.spec.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/__tests__/aws-ses-register-domain.service.spec.ts
index 9f4ba4f33fb..e6e917d125c 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/__tests__/aws-ses-register-domain.service.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/__tests__/aws-ses-register-domain.service.spec.ts
@@ -2,7 +2,6 @@ import {
AlreadyExistsException,
CreateConfigurationSetCommand,
CreateConfigurationSetEventDestinationCommand,
- CreateContactListCommand,
CreateTenantResourceAssociationCommand,
PutEmailIdentityMailFromAttributesCommand,
} from '@aws-sdk/client-sesv2';
@@ -22,7 +21,6 @@ describe('AwsSesRegisterDomainService', () => {
const provisionInput = {
tenantName: 'twenty-workspace-ws1',
configurationSetName: 'twenty-workspace-ws1',
- contactListName: 'twenty-workspace-ws1',
};
const buildAlreadyExists = () =>
@@ -56,7 +54,6 @@ describe('AwsSesRegisterDomainService', () => {
expect(commandTypes).toEqual([
CreateConfigurationSetCommand.name,
CreateConfigurationSetEventDestinationCommand.name,
- CreateContactListCommand.name,
CreateTenantResourceAssociationCommand.name,
]);
});
@@ -75,7 +72,6 @@ describe('AwsSesRegisterDomainService', () => {
expect(commandTypes).toEqual([
CreateConfigurationSetCommand.name,
CreateConfigurationSetEventDestinationCommand.name,
- CreateContactListCommand.name,
CreateTenantResourceAssociationCommand.name,
]);
});
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/__tests__/aws-ses-send-email.service.spec.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/__tests__/aws-ses-send-email.service.spec.ts
index 36e810d1384..c709ef74509 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/__tests__/aws-ses-send-email.service.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/__tests__/aws-ses-send-email.service.spec.ts
@@ -21,7 +21,6 @@ describe('AwsSesSendEmailService', () => {
const baseContext = {
tenantName: 'twenty-workspace-ws1',
configurationSetName: 'twenty-workspace-ws1',
- contactListName: 'twenty-workspace-ws1',
};
const setUp = () => {
@@ -42,7 +41,7 @@ describe('AwsSesSendEmailService', () => {
return { service, send, handleErrorService };
};
- it('should call SendEmail with tenant, config set, and list management options', async () => {
+ it('should call SendEmail with tenant and config set', async () => {
const { service, send } = setUp();
send.mockResolvedValue({ MessageId: 'msg-1' });
@@ -59,11 +58,8 @@ describe('AwsSesSendEmailService', () => {
Destination: { ToAddresses: ['[email protected]'] },
ConfigurationSetName: 'twenty-workspace-ws1',
TenantName: 'twenty-workspace-ws1',
- ListManagementOptions: {
- ContactListName: 'twenty-workspace-ws1',
- TopicName: 'marketing',
- },
});
+ expect(command.input.ListManagementOptions).toBeUndefined();
expect(command.input.EmailTags).toEqual(
expect.arrayContaining([
{ Name: 'workspace', Value: 'ws1' },
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-driver.service.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-driver.service.ts
index a9d23328e31..b8f9154e3ab 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-driver.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-driver.service.ts
@@ -6,7 +6,6 @@ import {
CreateTenantCommand,
CreateTenantResourceAssociationCommand,
DeleteConfigurationSetCommand,
- DeleteContactListCommand,
DeleteEmailIdentityCommand,
DeleteTenantCommand,
DeleteTenantResourceAssociationCommand,
@@ -21,10 +20,8 @@ import {
type EmailingDomainResourceInput,
type EmailingDomainVerificationResult,
} from 'src/engine/core-modules/emailing-domain/drivers/interfaces/emailing-domain-driver.interface';
-import {
- type EmailingDomainSendEmailInput,
- type EmailingDomainSendEmailResult,
-} from 'src/engine/core-modules/emailing-domain/drivers/types/send-email';
+import { type EmailingDomainSendEmailInput } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-input.type';
+import { type EmailingDomainSendEmailResult } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-result.type';
import { AWS_SES_RESOURCE_NAME_PREFIX } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/constants/aws-ses-resource-name-prefix.constant';
import { type AwsSesClientProvider } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/providers/aws-ses-client.provider';
@@ -120,7 +117,6 @@ export class AwsSesDriver implements EmailingDomainDriverInterface {
{
tenantName,
configurationSetName: this.buildConfigurationSetName(workspaceId),
- contactListName: this.buildContactListName(workspaceId),
},
this.config,
);
@@ -136,7 +132,6 @@ export class AwsSesDriver implements EmailingDomainDriverInterface {
return this.awsSesSendEmailService.sendEmail(input, {
tenantName: this.buildTenantName(input.workspaceId),
configurationSetName: this.buildConfigurationSetName(input.workspaceId),
- contactListName: this.buildContactListName(input.workspaceId),
});
}
@@ -167,7 +162,6 @@ export class AwsSesDriver implements EmailingDomainDriverInterface {
const sesClient = this.awsSesClientProvider.getSESClient();
const tenantName = this.buildTenantName(workspaceId);
const configurationSetName = this.buildConfigurationSetName(workspaceId);
- const contactListName = this.buildContactListName(workspaceId);
const configurationSetArn = `arn:aws:ses:${this.config.region}:${this.config.accountId}:configuration-set/${configurationSetName}`;
await sesClient
@@ -191,12 +185,6 @@ export class AwsSesDriver implements EmailingDomainDriverInterface {
if (!(error instanceof NotFoundException)) throw error;
});
- await sesClient
- .send(new DeleteContactListCommand({ ContactListName: contactListName }))
- .catch((error) => {
- if (!(error instanceof NotFoundException)) throw error;
- });
-
await sesClient
.send(new DeleteTenantCommand({ TenantName: tenantName }))
.catch((error) => {
@@ -212,10 +200,6 @@ export class AwsSesDriver implements EmailingDomainDriverInterface {
return `${AWS_SES_RESOURCE_NAME_PREFIX}-${workspaceId}`;
}
- private buildContactListName(workspaceId: string): string {
- return `${AWS_SES_RESOURCE_NAME_PREFIX}-${workspaceId}`;
- }
-
private async ensureTenantExists(tenantName: string): Promise<void> {
const sesClient = this.awsSesClientProvider.getSESClient();
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-register-domain.service.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-register-domain.service.ts
index e8c1e2fc72a..424b85e87f9 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-register-domain.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-register-domain.service.ts
@@ -4,7 +4,6 @@ import {
AlreadyExistsException,
CreateConfigurationSetCommand,
CreateConfigurationSetEventDestinationCommand,
- CreateContactListCommand,
CreateTenantResourceAssociationCommand,
PutEmailIdentityMailFromAttributesCommand,
} from '@aws-sdk/client-sesv2';
@@ -12,13 +11,11 @@ import { type AwsSesDriverConfig } from 'src/engine/core-modules/emailing-domain
import { AWS_SES_EVENT_BUS_NAME } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/constants/aws-ses-event-bus-name.constant';
import { AWS_SES_MAIL_FROM_SUBDOMAIN } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/constants/aws-ses-mail-from-subdomain.constant';
-import { AWS_SES_MARKETING_TOPIC_NAME } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/constants/aws-ses-marketing-topic-name.constant';
import { AwsSesClientProvider } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/providers/aws-ses-client.provider';
type ProvisionWorkspaceInput = {
tenantName: string;
configurationSetName: string;
- contactListName: string;
};
@Injectable()
@@ -42,7 +39,7 @@ export class AwsSesRegisterDomainService {
ConfigurationSetName: input.configurationSetName,
ReputationOptions: { ReputationMetricsEnabled: true },
SendingOptions: { SendingEnabled: true },
- SuppressionOptions: { SuppressedReasons: ['BOUNCE', 'COMPLAINT'] },
+ SuppressionOptions: { SuppressedReasons: [] },
Tags: [{ Key: 'managed-by', Value: 'twenty' }],
}),
)
@@ -79,26 +76,6 @@ export class AwsSesRegisterDomainService {
}
});
- await sesClient
- .send(
- new CreateContactListCommand({
- ContactListName: input.contactListName,
- Topics: [
- {
- TopicName: AWS_SES_MARKETING_TOPIC_NAME,
- DisplayName: 'Marketing',
- DefaultSubscriptionStatus: 'OPT_IN',
- },
- ],
- Tags: [{ Key: 'managed-by', Value: 'twenty' }],
- }),
- )
- .catch((error) => {
- if (!(error instanceof AlreadyExistsException)) {
- throw error;
- }
- });
-
await sesClient
.send(
new CreateTenantResourceAssociationCommand({
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-send-email.service.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-send-email.service.ts
index 6f2530a5d62..fb5120bb28d 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-send-email.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-send-email.service.ts
@@ -3,12 +3,9 @@ import { Injectable, Logger } from '@nestjs/common';
import { SendEmailCommand } from '@aws-sdk/client-sesv2';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
-import {
- type EmailingDomainSendEmailInput,
- type EmailingDomainSendEmailResult,
-} from 'src/engine/core-modules/emailing-domain/drivers/types/send-email';
+import { type EmailingDomainSendEmailInput } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-input.type';
+import { type EmailingDomainSendEmailResult } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-result.type';
-import { AWS_SES_MARKETING_TOPIC_NAME } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/constants/aws-ses-marketing-topic-name.constant';
import { AwsSesClientProvider } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/providers/aws-ses-client.provider';
import { AwsSesHandleErrorService } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-handle-error.service';
import {
@@ -19,7 +16,6 @@ import {
type SendEmailContext = {
tenantName: string;
configurationSetName: string;
- contactListName: string;
};
@Injectable()
@@ -56,6 +52,12 @@ export class AwsSesSendEmailService {
ReplyToAddresses: input.replyTo,
Content: {
Simple: {
+ Headers: isNonEmptyArray(input.headers)
+ ? input.headers.map((header) => ({
+ Name: header.name,
+ Value: header.value,
+ }))
+ : undefined,
Subject: { Data: input.subject, Charset: 'UTF-8' },
Body: {
Text: { Data: input.text, Charset: 'UTF-8' },
@@ -75,10 +77,6 @@ export class AwsSesSendEmailService {
},
ConfigurationSetName: context.configurationSetName,
TenantName: context.tenantName,
- ListManagementOptions: {
- ContactListName: context.contactListName,
- TopicName: AWS_SES_MARKETING_TOPIC_NAME,
- },
EmailTags: [
{ Name: 'workspace', Value: input.workspaceId },
{ Name: 'domain', Value: input.domain },
@@ -97,7 +95,14 @@ export class AwsSesSendEmailService {
`Sent email ${response.MessageId} from ${input.from} (tenant ${context.tenantName})`,
);
- return { messageId: response.MessageId };
+ return {
+ messageId: response.MessageId,
+ deliveredRecipients: {
+ to: input.to,
+ cc: input.cc ?? [],
+ bcc: input.bcc ?? [],
+ },
+ };
} catch (error) {
if (error instanceof EmailingDomainDriverException) {
throw error;
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/exceptions/emailing-domain-driver.exception.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/exceptions/emailing-domain-driver.exception.ts
index ff89ce9e1b7..b00338b6351 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/exceptions/emailing-domain-driver.exception.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/exceptions/emailing-domain-driver.exception.ts
@@ -11,6 +11,8 @@ export enum EmailingDomainDriverExceptionCode {
INSUFFICIENT_PERMISSIONS = 'INSUFFICIENT_PERMISSIONS',
CONFIGURATION_ERROR = 'CONFIGURATION_ERROR',
SENDING_SUSPENDED = 'SENDING_SUSPENDED',
+ ALL_RECIPIENTS_SUPPRESSED = 'ALL_RECIPIENTS_SUPPRESSED',
+ UNSUBSCRIBE_NOT_READY = 'UNSUBSCRIBE_NOT_READY',
UNKNOWN = 'UNKNOWN',
}
@@ -26,6 +28,10 @@ const getEmailingDomainDriverExceptionUserFriendlyMessage = (
return msg`Email domain configuration error.`;
case EmailingDomainDriverExceptionCode.SENDING_SUSPENDED:
return msg`Sending is currently suspended for this email domain.`;
+ case EmailingDomainDriverExceptionCode.ALL_RECIPIENTS_SUPPRESSED:
+ return msg`All recipients are suppressed for this email domain.`;
+ case EmailingDomainDriverExceptionCode.UNSUBSCRIBE_NOT_READY:
+ return msg`Marketing sending is on hold until the unsubscribe domain is verified.`;
case EmailingDomainDriverExceptionCode.TEMPORARY_ERROR:
case EmailingDomainDriverExceptionCode.UNKNOWN:
return STANDARD_ERROR_MESSAGE;
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/interfaces/emailing-domain-driver.interface.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/interfaces/emailing-domain-driver.interface.ts
index 10148089ce8..c3723707862 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/interfaces/emailing-domain-driver.interface.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/interfaces/emailing-domain-driver.interface.ts
@@ -1,7 +1,5 @@
-import {
- type EmailingDomainSendEmailInput,
- type EmailingDomainSendEmailResult,
-} from 'src/engine/core-modules/emailing-domain/drivers/types/send-email';
+import { type EmailingDomainSendEmailInput } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-input.type';
+import { type EmailingDomainSendEmailResult } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-result.type';
import { type EmailingDomainStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-status.type';
import { type VerificationRecord } from 'src/engine/core-modules/emailing-domain/drivers/types/verifications-record';
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/log/services/log-emailing-domain-driver.service.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/log/services/log-emailing-domain-driver.service.ts
index c11046662aa..5b7ee9e06cb 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/log/services/log-emailing-domain-driver.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/log/services/log-emailing-domain-driver.service.ts
@@ -8,10 +8,8 @@ import {
type EmailingDomainVerificationResult,
} from 'src/engine/core-modules/emailing-domain/drivers/interfaces/emailing-domain-driver.interface';
import { EmailingDomainStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-status.type';
-import {
- type EmailingDomainSendEmailInput,
- type EmailingDomainSendEmailResult,
-} from 'src/engine/core-modules/emailing-domain/drivers/types/send-email';
+import { type EmailingDomainSendEmailInput } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-input.type';
+import { type EmailingDomainSendEmailResult } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-result.type';
@Injectable()
export class LogEmailingDomainDriver implements EmailingDomainDriverInterface {
@@ -66,6 +64,13 @@ export class LogEmailingDomainDriver implements EmailingDomainDriverInterface {
`[log-driver] sendEmail from=${input.from} to=${input.to.join(',')} subject="${input.subject}" → fake messageId=${messageId}`,
);
- return { messageId };
+ return {
+ messageId,
+ deliveredRecipients: {
+ to: input.to,
+ cc: input.cc ?? [],
+ bcc: input.bcc ?? [],
+ },
+ };
}
}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-attachment.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-attachment.type.ts
new file mode 100644
index 00000000000..98bbb270891
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-attachment.type.ts
@@ -0,0 +1,5 @@
+export type EmailingDomainAttachment = {
+ filename: string;
+ content: Buffer;
+ contentType: string;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-email-content.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-email-content.type.ts
new file mode 100644
index 00000000000..b4c7908030a
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-email-content.type.ts
@@ -0,0 +1,16 @@
+import { type EmailingDomainAttachment } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-attachment.type';
+import { type EmailingDomainHeader } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-header.type';
+
+export type EmailingDomainEmailContent = {
+ from: string;
+ to: string[];
+ cc?: string[];
+ bcc?: string[];
+ subject: string;
+ text: string;
+ html?: string;
+ replyTo?: string[];
+ attachments?: EmailingDomainAttachment[];
+ headers?: EmailingDomainHeader[];
+ unsubscribeTopicId?: string;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-header.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-header.type.ts
new file mode 100644
index 00000000000..96b05dc2ab2
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-header.type.ts
@@ -0,0 +1,4 @@
+export type EmailingDomainHeader = {
+ name: string;
+ value: string;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-input.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-input.type.ts
new file mode 100644
index 00000000000..a49c288d8db
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-input.type.ts
@@ -0,0 +1,6 @@
+import { type EmailingDomainEmailContent } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-email-content.type';
+
+export type EmailingDomainSendEmailInput = EmailingDomainEmailContent & {
+ workspaceId: string;
+ domain: string;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-result.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-result.type.ts
new file mode 100644
index 00000000000..b1206b85fb8
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-result.type.ts
@@ -0,0 +1,4 @@
+export type EmailingDomainSendEmailResult = {
+ messageId: string;
+ deliveredRecipients: { to: string[]; cc: string[]; bcc: string[] };
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/send-email.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/send-email.ts
deleted file mode 100644
index e1e38d12e44..00000000000
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/send-email.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-export type EmailingDomainAttachment = {
- filename: string;
- content: Buffer;
- contentType: string;
-};
-
-export type EmailingDomainEmailContent = {
- from: string;
- to: string[];
- cc?: string[];
- bcc?: string[];
- subject: string;
- text: string;
- html?: string;
- replyTo?: string[];
- attachments?: EmailingDomainAttachment[];
-};
-
-export type EmailingDomainSendEmailInput = EmailingDomainEmailContent & {
- workspaceId: string;
- domain: string;
-};
-
-export type EmailingDomainSendEmailResult = {
- messageId: string;
-};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/unsubscribe-hostname-status.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/unsubscribe-hostname-status.type.ts
new file mode 100644
index 00000000000..a1669119317
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/drivers/types/unsubscribe-hostname-status.type.ts
@@ -0,0 +1,5 @@
+export enum UnsubscribeHostnameStatus {
+ PENDING = 'PENDING',
+ ACTIVE = 'ACTIVE',
+ FAILED = 'FAILED',
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/campaign-audience-preview.dto.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/campaign-audience-preview.dto.ts
new file mode 100644
index 00000000000..d32166dfa51
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/campaign-audience-preview.dto.ts
@@ -0,0 +1,22 @@
+import { Field, Int, ObjectType } from '@nestjs/graphql';
+
+@ObjectType()
+export class CampaignAudiencePreviewDTO {
+ @Field(() => Int)
+ totalMembers: number;
+
+ @Field(() => Int)
+ withoutEmail: number;
+
+ @Field(() => Int)
+ duplicateEmails: number;
+
+ @Field(() => Int)
+ globallyUnsubscribed: number;
+
+ @Field(() => Int)
+ topicUnsubscribed: number;
+
+ @Field(() => Int)
+ sendable: number;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/campaign-skipped-recipients.dto.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/campaign-skipped-recipients.dto.ts
new file mode 100644
index 00000000000..8b238cc57ec
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/campaign-skipped-recipients.dto.ts
@@ -0,0 +1,13 @@
+import { Field, Int, ObjectType } from '@nestjs/graphql';
+
+@ObjectType()
+export class CampaignSkippedRecipientsDTO {
+ @Field(() => Int)
+ noEmail: number;
+
+ @Field(() => Int)
+ deduped: number;
+
+ @Field(() => Int)
+ overCap: number;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/create-emailing-domain.input.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/create-emailing-domain.input.ts
new file mode 100644
index 00000000000..c6109269e1b
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/create-emailing-domain.input.ts
@@ -0,0 +1,16 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import { Matches, MaxLength } from 'class-validator';
+
+const DOMAIN_REGEX =
+ /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$/i;
+
+@InputType()
+export class CreateEmailingDomainInput {
+ @Field(() => String)
+ @MaxLength(255)
+ @Matches(DOMAIN_REGEX, {
+ message: 'domain must be a valid domain name (e.g. mail.example.com)',
+ })
+ domain: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/create-unsubscribe-topic.input.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/create-unsubscribe-topic.input.ts
new file mode 100644
index 00000000000..5d6b51bc475
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/create-unsubscribe-topic.input.ts
@@ -0,0 +1,24 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import { IsEnum, IsOptional, IsString, MaxLength } from 'class-validator';
+
+import { UnsubscribeTopicVisibility } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-topic-visibility.type';
+
+@InputType()
+export class CreateUnsubscribeTopicInput {
+ @Field(() => String)
+ @IsString()
+ @MaxLength(256)
+ name: string;
+
+ @Field(() => String, { nullable: true })
+ @IsOptional()
+ @IsString()
+ @MaxLength(1024)
+ description?: string;
+
+ @Field(() => UnsubscribeTopicVisibility, { nullable: true })
+ @IsOptional()
+ @IsEnum(UnsubscribeTopicVisibility)
+ visibility?: UnsubscribeTopicVisibility;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/preview-message-campaign-audience.input.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/preview-message-campaign-audience.input.ts
new file mode 100644
index 00000000000..935e98a07b1
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/preview-message-campaign-audience.input.ts
@@ -0,0 +1,15 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import { IsOptional, IsUUID } from 'class-validator';
+
+@InputType()
+export class PreviewMessageCampaignAudienceInput {
+ @Field(() => String)
+ @IsUUID('4')
+ listId: string;
+
+ @Field(() => String, { nullable: true })
+ @IsOptional()
+ @IsUUID('4')
+ unsubscribeTopicId?: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/send-message-campaign-output.dto.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/send-message-campaign-output.dto.ts
new file mode 100644
index 00000000000..2a5473f8611
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/send-message-campaign-output.dto.ts
@@ -0,0 +1,15 @@
+import { Field, Int, ObjectType } from '@nestjs/graphql';
+
+import { CampaignSkippedRecipientsDTO } from 'src/engine/core-modules/emailing-domain/dtos/campaign-skipped-recipients.dto';
+
+@ObjectType()
+export class SendMessageCampaignOutputDTO {
+ @Field(() => String)
+ campaignId: string;
+
+ @Field(() => Int)
+ queuedCount: number;
+
+ @Field(() => CampaignSkippedRecipientsDTO)
+ skipped: CampaignSkippedRecipientsDTO;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/send-message-campaign.input.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/send-message-campaign.input.ts
new file mode 100644
index 00000000000..6e1c9491fa8
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/send-message-campaign.input.ts
@@ -0,0 +1,36 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import {
+ IsEmail,
+ IsOptional,
+ IsString,
+ IsUUID,
+ Length,
+ MinLength,
+} from 'class-validator';
+
+@InputType()
+export class SendMessageCampaignInput {
+ @Field(() => String)
+ @IsUUID('4')
+ listId: string;
+
+ @Field(() => String, { nullable: true })
+ @IsOptional()
+ @IsUUID('4')
+ unsubscribeTopicId?: string;
+
+ @Field(() => String)
+ @IsString()
+ @Length(1, 998)
+ subject: string;
+
+ @Field(() => String)
+ @IsString()
+ @MinLength(1)
+ body: string;
+
+ @Field(() => String)
+ @IsEmail()
+ fromAddress: string;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/unsubscribe-topic.dto.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/unsubscribe-topic.dto.ts
new file mode 100644
index 00000000000..7cf0929e262
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/unsubscribe-topic.dto.ts
@@ -0,0 +1,31 @@
+import { Field, ObjectType, registerEnumType } from '@nestjs/graphql';
+
+import { IDField } from '@ptc-org/nestjs-query-graphql';
+
+import { UUIDScalarType } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/scalars';
+import { UnsubscribeTopicVisibility } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-topic-visibility.type';
+
+registerEnumType(UnsubscribeTopicVisibility, {
+ name: 'UnsubscribeTopicVisibility',
+});
+
+@ObjectType('UnsubscribeTopic')
+export class UnsubscribeTopicDTO {
+ @IDField(() => UUIDScalarType)
+ id: string;
+
+ @Field(() => Date)
+ createdAt: Date;
+
+ @Field(() => Date)
+ updatedAt: Date;
+
+ @Field(() => String, { nullable: true })
+ name: string | null;
+
+ @Field(() => String, { nullable: true })
+ description: string | null;
+
+ @Field(() => UnsubscribeTopicVisibility)
+ visibility: UnsubscribeTopicVisibility;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/update-unsubscribe-topic.input.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/update-unsubscribe-topic.input.ts
new file mode 100644
index 00000000000..c06b11234c7
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/dtos/update-unsubscribe-topic.input.ts
@@ -0,0 +1,35 @@
+import { Field, InputType } from '@nestjs/graphql';
+
+import {
+ IsEnum,
+ IsOptional,
+ IsString,
+ IsUUID,
+ MaxLength,
+} from 'class-validator';
+
+import { UnsubscribeTopicVisibility } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-topic-visibility.type';
+
+@InputType()
+export class UpdateUnsubscribeTopicInput {
+ @Field(() => String)
+ @IsUUID('4')
+ id: string;
+
+ @Field(() => String, { nullable: true })
+ @IsOptional()
+ @IsString()
+ @MaxLength(256)
+ name?: string;
+
+ @Field(() => String, { nullable: true })
+ @IsOptional()
+ @IsString()
+ @MaxLength(1024)
+ description?: string;
+
+ @Field(() => UnsubscribeTopicVisibility, { nullable: true })
+ @IsOptional()
+ @IsEnum(UnsubscribeTopicVisibility)
+ visibility?: UnsubscribeTopicVisibility;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.entity.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.entity.ts
index 96d2a522953..9bb2670df45 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.entity.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.entity.ts
@@ -11,6 +11,7 @@ import {
import { EmailingDomainStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-status.type';
import { EmailingDomainTenantStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-tenant-status.type';
+import { UnsubscribeHostnameStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/unsubscribe-hostname-status.type';
import { VerificationRecord } from 'src/engine/core-modules/emailing-domain/drivers/types/verifications-record';
import { WorkspaceRelatedEntity } from 'src/engine/workspace-manager/types/workspace-related-entity';
@@ -51,4 +52,17 @@ export class EmailingDomainEntity extends WorkspaceRelatedEntity {
nullable: false,
})
tenantStatus: EmailingDomainTenantStatus;
+
+ @Column({ type: 'varchar', nullable: true })
+ unsubscribeHostname: string | null;
+
+ @Column({ type: 'varchar', nullable: true })
+ unsubscribeHostnameId: string | null;
+
+ @Column({
+ type: 'enum',
+ enum: Object.values(UnsubscribeHostnameStatus),
+ nullable: true,
+ })
+ unsubscribeHostnameStatus: UnsubscribeHostnameStatus | null;
}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.module.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.module.ts
index 698f498a1e1..e52f34ed87d 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.module.ts
@@ -3,6 +3,7 @@ import { Module } from '@nestjs/common';
import { NestjsQueryTypeOrmModule } from '@ptc-org/nestjs-query-typeorm';
import { TypeORMModule } from 'src/database/typeorm/typeorm.module';
+import { DnsManagerModule } from 'src/engine/core-modules/dns-manager/dns-manager.module';
import { AwsSesClientProvider } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/providers/aws-ses-client.provider';
import { AwsSesRegisterDomainService } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-register-domain.service';
import { AwsSesHandleErrorService } from 'src/engine/core-modules/emailing-domain/drivers/aws-ses/services/aws-ses-handle-error.service';
@@ -14,20 +15,33 @@ import { EmailingDomainResolver } from 'src/engine/core-modules/emailing-domain/
import { EmailingDomainWorkspaceCleanupJob } from 'src/engine/core-modules/emailing-domain/jobs/emailing-domain-workspace-cleanup.job';
import { EmailingDomainTenantStatusService } from 'src/engine/core-modules/emailing-domain/services/emailing-domain-tenant-status.service';
import { EmailingDomainService } from 'src/engine/core-modules/emailing-domain/services/emailing-domain.service';
+import { UnsubscribeHostnameService } from 'src/engine/core-modules/emailing-domain/services/unsubscribe-hostname.service';
+import { UnsubscribeTokenService } from 'src/engine/core-modules/emailing-domain/services/unsubscribe-token.service';
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
import { PermissionsModule } from 'src/engine/metadata-modules/permissions/permissions.module';
+import { SecretEncryptionModule } from 'src/engine/core-modules/secret-encryption/secret-encryption.module';
import { provideWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/provide-workspace-scoped-repository';
+
@Module({
imports: [
TypeORMModule,
NestjsQueryTypeOrmModule.forFeature([EmailingDomainEntity]),
FeatureFlagModule,
PermissionsModule,
+ DnsManagerModule,
+ SecretEncryptionModule,
+ ],
+ exports: [
+ EmailingDomainService,
+ EmailingDomainTenantStatusService,
+ EmailingDomainDriverFactory,
+ UnsubscribeTokenService,
],
- exports: [EmailingDomainService, EmailingDomainTenantStatusService],
providers: [
EmailingDomainService,
EmailingDomainTenantStatusService,
+ UnsubscribeTokenService,
+ UnsubscribeHostnameService,
EmailingDomainResolver,
EmailingDomainDriverFactory,
EmailingDomainWorkspaceCleanupJob,
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.resolver.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.resolver.ts
index 28d042f961a..9a2bcd67f91 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.resolver.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/emailing-domain.resolver.ts
@@ -5,9 +5,8 @@ import { PermissionFlagType } from 'twenty-shared/constants';
import { FeatureFlagKey } from 'twenty-shared/types';
import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
+import { CreateEmailingDomainInput } from 'src/engine/core-modules/emailing-domain/dtos/create-emailing-domain.input';
import { EmailingDomainDTO } from 'src/engine/core-modules/emailing-domain/dtos/emailing-domain.dto';
-import { SendEmailViaDomainOutputDTO } from 'src/engine/core-modules/emailing-domain/dtos/send-email-via-domain-output.dto';
-import { SendEmailViaDomainInput } from 'src/engine/core-modules/emailing-domain/dtos/send-email-via-domain.input';
import { EmailingDomainService } from 'src/engine/core-modules/emailing-domain/services/emailing-domain.service';
import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
@@ -32,13 +31,13 @@ export class EmailingDomainResolver {
@Mutation(() => EmailingDomainDTO)
@RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
async createEmailingDomain(
- @Args('domain') domain: string,
+ @Args('input') input: CreateEmailingDomainInput,
@AuthWorkspace() currentWorkspace: WorkspaceEntity,
): Promise<EmailingDomainDTO> {
const emailingDomain =
await this.emailingDomainService.createEmailingDomain(
- domain,
- currentWorkspace,
+ input.domain.trim().toLowerCase(),
+ currentWorkspace.id,
);
return emailingDomain;
@@ -70,22 +69,6 @@ export class EmailingDomainResolver {
return emailingDomain;
}
- @Mutation(() => SendEmailViaDomainOutputDTO)
- @RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
- async sendEmailViaEmailingDomain(
- @Args('input') input: SendEmailViaDomainInput,
- @AuthWorkspace() currentWorkspace: WorkspaceEntity,
- ): Promise<SendEmailViaDomainOutputDTO> {
- const { emailingDomainId, ...content } = input;
- const result = await this.emailingDomainService.sendEmail(
- currentWorkspace.id,
- emailingDomainId,
- content,
- );
-
- return { messageId: result.messageId };
- }
-
@Query(() => [EmailingDomainDTO])
@RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
async getEmailingDomains(
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/message-suppression.entity.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/message-suppression.entity.ts
new file mode 100644
index 00000000000..910d13c22a3
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/message-suppression.entity.ts
@@ -0,0 +1,65 @@
+import {
+ Column,
+ CreateDateColumn,
+ Entity,
+ Index,
+ PrimaryGeneratedColumn,
+ UpdateDateColumn,
+} from 'typeorm';
+
+import { MessageSuppressionReason } from 'src/engine/core-modules/emailing-domain/types/message-suppression-reason.type';
+import { MessageSuppressionSource } from 'src/engine/core-modules/emailing-domain/types/message-suppression-source.type';
+import { WorkspaceRelatedEntity } from 'src/engine/workspace-manager/types/workspace-related-entity';
+
+// Two partial indexes because Postgres treats NULLs as distinct: one global
+// block per (workspace, address), one opt-out per (workspace, address, topic).
+// NOT decorated with @WasIntroducedInUpgrade: a missing-table error that fails
+// sends is safer than silently skipping suppression during a deploy window.
+@Entity({ name: 'messageSuppression', schema: 'core' })
+@Index(
+ 'IDX_MESSAGE_SUPPRESSION_GLOBAL_UNIQUE',
+ ['workspaceId', 'emailAddress'],
+ {
+ unique: true,
+ where: '"unsubscribeTopicId" IS NULL',
+ },
+)
+@Index(
+ 'IDX_MESSAGE_SUPPRESSION_TOPIC_UNIQUE',
+ ['workspaceId', 'emailAddress', 'unsubscribeTopicId'],
+ { unique: true, where: '"unsubscribeTopicId" IS NOT NULL' },
+)
+@Index('IDX_MESSAGE_SUPPRESSION_WORKSPACE_ID', ['workspaceId'])
+export class MessageSuppressionEntity extends WorkspaceRelatedEntity {
+ @PrimaryGeneratedColumn('uuid')
+ id: string;
+
+ @CreateDateColumn({ type: 'timestamptz' })
+ createdAt: Date;
+
+ @UpdateDateColumn({ type: 'timestamptz' })
+ updatedAt: Date;
+
+ @Column({ type: 'varchar', nullable: false })
+ emailAddress: string;
+
+ @Column({
+ type: 'enum',
+ enum: Object.values(MessageSuppressionReason),
+ nullable: false,
+ })
+ reason: MessageSuppressionReason;
+
+ @Column({
+ type: 'enum',
+ enum: Object.values(MessageSuppressionSource),
+ nullable: false,
+ })
+ source: MessageSuppressionSource;
+
+ @Column({ type: 'varchar', nullable: true })
+ providerEventId: string | null;
+
+ @Column({ type: 'uuid', nullable: true })
+ unsubscribeTopicId: string | null;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/services/__tests__/emailing-domain.service.spec.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/services/__tests__/emailing-domain.service.spec.ts
deleted file mode 100644
index ffc093cba61..00000000000
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/services/__tests__/emailing-domain.service.spec.ts
+++ /dev/null
@@ -1,97 +0,0 @@
-import { EmailingDomainDriverExceptionCode } from 'src/engine/core-modules/emailing-domain/drivers/exceptions/emailing-domain-driver.exception';
-import { type EmailingDomainDriverFactory } from 'src/engine/core-modules/emailing-domain/drivers/emailing-domain-driver.factory';
-import { EmailingDomainStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-status.type';
-import { EmailingDomainTenantStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-tenant-status.type';
-import { type EmailingDomainEntity } from 'src/engine/core-modules/emailing-domain/emailing-domain.entity';
-import { EmailingDomainService } from 'src/engine/core-modules/emailing-domain/services/emailing-domain.service';
-import { type WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/workspace-scoped-repository';
-
-describe('EmailingDomainService.sendEmail', () => {
- const buildEmailingDomain = (
- overrides: Partial<EmailingDomainEntity> = {},
- ): EmailingDomainEntity =>
- ({
- id: 'domain-1',
- workspaceId: 'ws1',
- domain: 'mail.example.com',
- status: EmailingDomainStatus.VERIFIED,
- tenantStatus: EmailingDomainTenantStatus.ACTIVE,
- ...overrides,
- }) as EmailingDomainEntity;
-
- const buildEmailContent = () => ({
- subject: 'Hi',
- text: 'Body',
- });
-
- const setUp = (emailingDomain: EmailingDomainEntity) => {
- const sendEmail = jest.fn().mockResolvedValue({ messageId: 'msg-1' });
- const repository = {
- findOne: jest.fn().mockResolvedValue(emailingDomain),
- } as unknown as WorkspaceScopedRepository<EmailingDomainEntity>;
- const factory = {
- getCurrentDriver: () => ({ sendEmail }),
- } as unknown as EmailingDomainDriverFactory;
- const service = new EmailingDomainService(repository, factory);
-
- return { service, sendEmail };
- };
-
- it('delegates to the driver when the domain is verified and the tenant is active', async () => {
- const { service, sendEmail } = setUp(buildEmailingDomain());
-
- const result = await service.sendEmail(
- 'ws1',
- 'domain-1',
- buildEmailContent(),
- );
-
- expect(result.messageId).toBe('msg-1');
- expect(sendEmail).toHaveBeenCalledWith(
- expect.objectContaining({
- workspaceId: 'ws1',
- domain: 'mail.example.com',
- }),
- );
- });
-
- it.each([
- EmailingDomainTenantStatus.PAUSED,
- EmailingDomainTenantStatus.PERMANENTLY_SUSPENDED,
- ])(
- 'rejects sending with SENDING_SUSPENDED when tenantStatus is %s, without calling the driver',
- async (tenantStatus) => {
- const { service, sendEmail } = setUp(
- buildEmailingDomain({ tenantStatus }),
- );
-
- await expect(
- service.sendEmail('ws1', 'domain-1', buildEmailContent()),
- ).rejects.toMatchObject({
- code: EmailingDomainDriverExceptionCode.SENDING_SUSPENDED,
- });
- expect(sendEmail).not.toHaveBeenCalled();
- },
- );
-
- // Verification is a precondition for the tenant-status check: a domain that
- // has not been verified should surface a CONFIGURATION_ERROR rather than
- // leaking the tenant pause state to callers who couldn't have used it anyway.
- it('reports the verification failure before the tenant-status failure', async () => {
- const { service } = setUp(
- buildEmailingDomain({
- status: EmailingDomainStatus.PENDING,
- tenantStatus: EmailingDomainTenantStatus.PAUSED,
- }),
- );
-
- await expect(
- service.sendEmail('ws1', 'domain-1', buildEmailContent()),
- ).rejects.toMatchObject({
- code: EmailingDomainDriverExceptionCode.CONFIGURATION_ERROR,
- });
- });
-});
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/services/emailing-domain.service.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/services/emailing-domain.service.ts
index dda2e710ddb..dc801ee30a7 100644
--- a/packages/twenty-server/src/engine/core-modules/emailing-domain/services/emailing-domain.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/services/emailing-domain.service.ts
@@ -1,20 +1,19 @@
import { Injectable, Logger } from '@nestjs/common';
+import { isDefined } from 'twenty-shared/utils';
+
import {
EmailingDomainDriverException,
EmailingDomainDriverExceptionCode,
} from 'src/engine/core-modules/emailing-domain/drivers/exceptions/emailing-domain-driver.exception';
import { EmailingDomainDriverFactory } from 'src/engine/core-modules/emailing-domain/drivers/emailing-domain-driver.factory';
import { EmailingDomainStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-status.type';
-import { EmailingDomainTenantStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-tenant-status.type';
-import {
- type EmailingDomainEmailContent,
- type EmailingDomainSendEmailResult,
-} from 'src/engine/core-modules/emailing-domain/drivers/types/send-email';
import { EmailingDomainEntity } from 'src/engine/core-modules/emailing-domain/emailing-domain.entity';
+import { UnsubscribeHostnameService } from 'src/engine/core-modules/emailing-domain/services/unsubscribe-hostname.service';
import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
import { InjectWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/inject-workspace-scoped-repository.decorator';
import { WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/workspace-scoped-repository';
+
@Injectable()
export class EmailingDomainService {
private readonly logger = new Logger(EmailingDomainService.name);
@@ -23,14 +22,15 @@ export class EmailingDomainService {
@InjectWorkspaceScopedRepository(EmailingDomainEntity)
private readonly emailingDomainRepository: WorkspaceScopedRepository<EmailingDomainEntity>,
private readonly emailingDomainDriverFactory: EmailingDomainDriverFactory,
+ private readonly unsubscribeHostnameService: UnsubscribeHostnameService,
) {}
async createEmailingDomain(
domain: string,
- workspace: WorkspaceEntity,
+ workspaceId: string,
): Promise<EmailingDomainEntity> {
const existingEmailingDomain = await this.emailingDomainRepository.findOne(
- workspace.id,
+ workspaceId,
{
where: { domain },
},
@@ -46,26 +46,81 @@ export class EmailingDomainService {
const emailingDomainDriver =
this.emailingDomainDriverFactory.getCurrentDriver();
- await emailingDomainDriver.provisionWorkspace(workspace.id);
+ await emailingDomainDriver.provisionWorkspace(workspaceId);
const verificationResult = await emailingDomainDriver.verifyDomain({
domain,
- workspaceId: workspace.id,
+ workspaceId,
});
await emailingDomainDriver.registerDomain({
domain,
- workspaceId: workspace.id,
+ workspaceId,
});
const isVerifiedOnCreation =
verificationResult.status === EmailingDomainStatus.VERIFIED;
- return this.emailingDomainRepository.save(workspace.id, {
- domain,
- status: verificationResult.status,
- verificationRecords: verificationResult.verificationRecords,
- verifiedAt: isVerifiedOnCreation ? new Date() : null,
+ const emailingDomain = await this.emailingDomainRepository.save(
+ workspaceId,
+ {
+ domain,
+ status: verificationResult.status,
+ verificationRecords: verificationResult.verificationRecords,
+ verifiedAt: isVerifiedOnCreation ? new Date() : null,
+ },
+ );
+
+ if (isVerifiedOnCreation) {
+ await this.unsubscribeHostnameService.sync(
+ workspaceId,
+ emailingDomain.id,
+ {
+ provision: true,
+ },
+ );
+ }
+
+ return this.unsubscribeHostnameService.withDnsRecords(
+ await this.emailingDomainRepository.findOneOrFail(workspaceId, {
+ where: { id: emailingDomain.id },
+ }),
+ );
+ }
+
+ async ensureEmailingDomain(
+ domain: string,
+ workspaceId: string,
+ ): Promise<void> {
+ const existingEmailingDomain = await this.emailingDomainRepository.findOne(
+ workspaceId,
+ { where: { domain } },
+ );
+
+ if (isDefined(existingEmailingDomain)) {
+ return;
+ }
+
+ await this.createEmailingDomain(domain, workspaceId);
+ }
+
+ async deleteEmailingDomainByDomainIfExists(
+ workspaceId: string,
+ domain: string,
+ ): Promise<void> {
+ const emailingDomain = await this.emailingDomainRepository.findOne(
+ workspaceId,
+ { where: { domain } },
+ );
+
+ if (!isDefined(emailingDomain)) {
+ return;
+ }
+
+ await this.unsubscribeHostnameService.deprovision(emailingDomain);
+ await this.deleteRemoteEmailingDomain(emailingDomain);
+ await this.emailingDomainRepository.delete(workspaceId, {
+ id: emailingDomain.id,
});
}
@@ -78,6 +133,7 @@ export class EmailingDomainService {
emailingDomainId,
);
+ await this.unsubscribeHostnameService.deprovision(emailingDomain);
await this.deleteRemoteEmailingDomain(emailingDomain);
await this.emailingDomainRepository.delete(workspace.id, {
id: emailingDomain.id,
@@ -113,9 +169,18 @@ export class EmailingDomainService {
async getEmailingDomains(
workspace: WorkspaceEntity,
): Promise<EmailingDomainEntity[]> {
- return this.emailingDomainRepository.find(workspace.id, {
- order: { createdAt: 'DESC' },
- });
+ const emailingDomains = await this.emailingDomainRepository.find(
+ workspace.id,
+ {
+ order: { createdAt: 'DESC' },
+ },
+ );
+
+ return Promise.all(
+ emailingDomains.map((emailingDomain) =>
+ this.unsubscribeHostnameService.withDnsRecords(emailingDomain),
+ ),
+ );
}
async verifyEmailingDomain(
@@ -149,49 +214,19 @@ export class EmailingDomainService {
},
);
- return this.emailingDomainRepository.findOneOrFail(workspace.id, {
- where: { id: emailingDomain.id },
- });
- }
-
- async sendEmail(
- workspaceId: string,
- emailingDomainId: string,
- emailContent: EmailingDomainEmailContent,
- ): Promise<EmailingDomainSendEmailResult> {
- const emailingDomain = await this.findEmailingDomainByIdOrThrow(
- workspaceId,
- emailingDomainId,
+ await this.unsubscribeHostnameService.sync(
+ workspace.id,
+ emailingDomain.id,
+ {
+ provision: verificationResult.status === EmailingDomainStatus.VERIFIED,
+ },
);
- if (emailingDomain.status !== EmailingDomainStatus.VERIFIED) {
- throw new EmailingDomainDriverException(
- `Emailing domain is not verified (status: ${emailingDomain.status})`,
- EmailingDomainDriverExceptionCode.CONFIGURATION_ERROR,
- );
- }
-
- if (emailingDomain.tenantStatus !== EmailingDomainTenantStatus.ACTIVE) {
- throw new EmailingDomainDriverException(
- `Sending is suspended for emailing domain ${emailingDomain.domain} (tenantStatus: ${emailingDomain.tenantStatus})`,
- EmailingDomainDriverExceptionCode.SENDING_SUSPENDED,
- );
- }
-
- const fromAddressDomain = emailContent.from.split('@')[1]?.toLowerCase();
-
- if (fromAddressDomain !== emailingDomain.domain.toLowerCase()) {
- throw new EmailingDomainDriverException(
- `From address ${emailContent.from} does not match verified domain ${emailingDomain.domain}`,
- EmailingDomainDriverExceptionCode.CONFIGURATION_ERROR,
- );
- }
-
- return this.emailingDomainDriverFactory.getCurrentDriver().sendEmail({
- ...emailContent,
- workspaceId,
- domain: emailingDomain.domain,
- });
+ return this.unsubscribeHostnameService.withDnsRecords(
+ await this.emailingDomainRepository.findOneOrFail(workspace.id, {
+ where: { id: emailingDomain.id },
+ }),
+ );
}
private async findEmailingDomainByIdOrThrow(
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/services/unsubscribe-hostname.service.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/services/unsubscribe-hostname.service.ts
new file mode 100644
index 00000000000..7b7e810fad8
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/services/unsubscribe-hostname.service.ts
@@ -0,0 +1,181 @@
+/* @license Enterprise */
+import { Injectable, Logger } from '@nestjs/common';
+
+import { isNonEmptyString } from '@sniptt/guards';
+import { isDefined } from 'twenty-shared/utils';
+
+import {
+ DnsManagerException,
+ DnsManagerExceptionCode,
+} from 'src/engine/core-modules/dns-manager/exceptions/dns-manager.exception';
+import { UNSUBSCRIBE_HOSTNAME_PREFIX } from 'src/engine/core-modules/emailing-domain/constants/unsubscribe-hostname-prefix.constant';
+import { UnsubscribeHostnameStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/unsubscribe-hostname-status.type';
+import { type VerificationRecord } from 'src/engine/core-modules/emailing-domain/drivers/types/verifications-record';
+import { EmailingDomainEntity } from 'src/engine/core-modules/emailing-domain/emailing-domain.entity';
+import { DnsManagerService } from 'src/engine/core-modules/dns-manager/services/dns-manager.service';
+import { InjectWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/inject-workspace-scoped-repository.decorator';
+import { WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/workspace-scoped-repository';
+
+@Injectable()
+export class UnsubscribeHostnameService {
+ private readonly logger = new Logger(UnsubscribeHostnameService.name);
+
+ constructor(
+ @InjectWorkspaceScopedRepository(EmailingDomainEntity)
+ private readonly emailingDomainRepository: WorkspaceScopedRepository<EmailingDomainEntity>,
+ private readonly dnsManagerService: DnsManagerService,
+ ) {}
+
+ async provision(emailingDomain: EmailingDomainEntity): Promise<void> {
+ if (isNonEmptyString(emailingDomain.unsubscribeHostnameId)) {
+ return;
+ }
+
+ const hostname = this.buildHostname(emailingDomain.domain);
+
+ const unsubscribeHostnameId = await this.registerOrAdoptHostname(hostname);
+
+ await this.emailingDomainRepository.update(
+ emailingDomain.workspaceId,
+ { id: emailingDomain.id },
+ {
+ unsubscribeHostname: hostname,
+ unsubscribeHostnameId,
+ unsubscribeHostnameStatus: UnsubscribeHostnameStatus.PENDING,
+ },
+ );
+ }
+
+ private async registerOrAdoptHostname(hostname: string): Promise<string> {
+ try {
+ const createdHostname =
+ await this.dnsManagerService.registerHostname(hostname);
+
+ return createdHostname.id;
+ } catch (error) {
+ if (
+ error instanceof DnsManagerException &&
+ error.code === DnsManagerExceptionCode.HOSTNAME_ALREADY_REGISTERED
+ ) {
+ const existingHostnameId =
+ await this.dnsManagerService.getHostnameId(hostname);
+
+ if (isNonEmptyString(existingHostnameId)) {
+ return existingHostnameId;
+ }
+ }
+
+ throw error;
+ }
+ }
+
+ async refreshStatus(emailingDomain: EmailingDomainEntity): Promise<void> {
+ if (!isNonEmptyString(emailingDomain.unsubscribeHostname)) {
+ return;
+ }
+
+ const isWorking = await this.dnsManagerService.isHostnameWorking(
+ emailingDomain.unsubscribeHostname,
+ );
+
+ await this.emailingDomainRepository.update(
+ emailingDomain.workspaceId,
+ { id: emailingDomain.id },
+ {
+ unsubscribeHostnameStatus: isWorking
+ ? UnsubscribeHostnameStatus.ACTIVE
+ : UnsubscribeHostnameStatus.PENDING,
+ },
+ );
+ }
+
+ async deprovision(emailingDomain: EmailingDomainEntity): Promise<void> {
+ if (!isNonEmptyString(emailingDomain.unsubscribeHostname)) {
+ return;
+ }
+
+ await this.dnsManagerService.deleteHostnameSilently(
+ emailingDomain.unsubscribeHostname,
+ );
+ }
+
+ async sync(
+ workspaceId: string,
+ emailingDomainId: string,
+ { provision }: { provision: boolean },
+ ): Promise<void> {
+ try {
+ const emailingDomain = await this.emailingDomainRepository.findOneOrFail(
+ workspaceId,
+ { where: { id: emailingDomainId } },
+ );
+
+ if (provision) {
+ await this.provision(emailingDomain);
+ }
+
+ await this.refreshStatus(
+ await this.emailingDomainRepository.findOneOrFail(workspaceId, {
+ where: { id: emailingDomainId },
+ }),
+ );
+ } catch (error) {
+ this.logger.warn(
+ `Failed to sync unsubscribe hostname for emailing domain ${emailingDomainId}: ${error}`,
+ );
+ }
+ }
+
+ async withDnsRecords(
+ emailingDomain: EmailingDomainEntity,
+ ): Promise<EmailingDomainEntity> {
+ const unsubscribeRecords = await this.getDnsRecords(emailingDomain);
+
+ if (unsubscribeRecords.length === 0) {
+ return emailingDomain;
+ }
+
+ return {
+ ...emailingDomain,
+ verificationRecords: [
+ ...(emailingDomain.verificationRecords ?? []),
+ ...unsubscribeRecords,
+ ],
+ };
+ }
+
+ async getDnsRecords(
+ emailingDomain: EmailingDomainEntity,
+ ): Promise<VerificationRecord[]> {
+ if (!isNonEmptyString(emailingDomain.unsubscribeHostname)) {
+ return [];
+ }
+
+ try {
+ const hostnameWithRecords =
+ await this.dnsManagerService.getHostnameWithRecords(
+ emailingDomain.unsubscribeHostname,
+ );
+
+ if (!isDefined(hostnameWithRecords)) {
+ return [];
+ }
+
+ return hostnameWithRecords.records.map((record) => ({
+ type: 'CNAME' as const,
+ key: record.key,
+ value: record.value,
+ }));
+ } catch (error) {
+ this.logger.warn(
+ `Failed to read unsubscribe DNS records for ${emailingDomain.unsubscribeHostname}: ${error}`,
+ );
+
+ return [];
+ }
+ }
+
+ private buildHostname(domain: string): string {
+ return `${UNSUBSCRIBE_HOSTNAME_PREFIX}.${domain}`;
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/services/unsubscribe-token.service.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/services/unsubscribe-token.service.ts
new file mode 100644
index 00000000000..7892fb12a75
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/services/unsubscribe-token.service.ts
@@ -0,0 +1,55 @@
+import { Injectable } from '@nestjs/common';
+
+import { type EncryptedString } from 'src/engine/core-modules/secret-encryption/branded-strings/encrypted-string.type';
+import { type PlaintextString } from 'src/engine/core-modules/secret-encryption/branded-strings/plaintext-string.type';
+import { SecretEncryptionService } from 'src/engine/core-modules/secret-encryption/secret-encryption.service';
+import { type UnsubscribeTokenPayload } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-token-payload.type';
+
+@Injectable()
+export class UnsubscribeTokenService {
+ constructor(
+ private readonly secretEncryptionService: SecretEncryptionService,
+ ) {}
+
+ sign(payload: Omit<UnsubscribeTokenPayload, 'issuedAt'>): string {
+ const stampedPayload: UnsubscribeTokenPayload = {
+ ...payload,
+ issuedAt: Date.now(),
+ };
+
+ return Buffer.from(
+ this.secretEncryptionService.encryptVersioned(
+ JSON.stringify(stampedPayload) as PlaintextString,
+ ),
+ ).toString('base64url');
+ }
+
+ verify(token: string): UnsubscribeTokenPayload | null {
+ try {
+ const decrypted = this.secretEncryptionService.decryptVersioned(
+ Buffer.from(token, 'base64url').toString('utf8') as EncryptedString,
+ );
+
+ const decoded = JSON.parse(decrypted);
+
+ if (
+ typeof decoded?.workspaceId !== 'string' ||
+ typeof decoded?.emailAddress !== 'string'
+ ) {
+ return null;
+ }
+
+ return {
+ workspaceId: decoded.workspaceId,
+ emailAddress: decoded.emailAddress,
+ issuedAt: typeof decoded?.issuedAt === 'number' ? decoded.issuedAt : 0,
+ ...(typeof decoded?.unsubscribeTopicId === 'string'
+ ? { unsubscribeTopicId: decoded.unsubscribeTopicId }
+ : {}),
+ ...(decoded?.preview === true ? { preview: true } : {}),
+ };
+ } catch {
+ return null;
+ }
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/campaign-recipient.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/campaign-recipient.type.ts
new file mode 100644
index 00000000000..ff591fad519
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/campaign-recipient.type.ts
@@ -0,0 +1,4 @@
+export type CampaignRecipient = {
+ personId: string;
+ email: string;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/campaign-skipped-breakdown.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/campaign-skipped-breakdown.type.ts
new file mode 100644
index 00000000000..7c8290e34d8
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/campaign-skipped-breakdown.type.ts
@@ -0,0 +1,5 @@
+export type CampaignSkippedBreakdown = {
+ noEmail: number;
+ deduped: number;
+ overCap: number;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/deliverable-recipients.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/deliverable-recipients.type.ts
new file mode 100644
index 00000000000..47a487c1117
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/deliverable-recipients.type.ts
@@ -0,0 +1,5 @@
+export type DeliverableRecipients = {
+ to: string[];
+ cc?: string[];
+ bcc?: string[];
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/materialize-campaign-job-data.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/materialize-campaign-job-data.type.ts
new file mode 100644
index 00000000000..74517b2942a
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/materialize-campaign-job-data.type.ts
@@ -0,0 +1,9 @@
+import { type CampaignRecipient } from 'src/engine/core-modules/emailing-domain/types/campaign-recipient.type';
+
+export type MaterializeCampaignJobData = {
+ workspaceId: string;
+ campaignId: string;
+ messageChannelId: string;
+ emailingDomainId: string;
+ recipients: CampaignRecipient[];
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/message-suppression-reason.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/message-suppression-reason.type.ts
new file mode 100644
index 00000000000..73aa0c24c6a
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/message-suppression-reason.type.ts
@@ -0,0 +1,5 @@
+export enum MessageSuppressionReason {
+ BOUNCE = 'BOUNCE',
+ COMPLAINT = 'COMPLAINT',
+ UNSUBSCRIBE = 'UNSUBSCRIBE',
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/message-suppression-source.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/message-suppression-source.type.ts
new file mode 100644
index 00000000000..b5b47897728
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/message-suppression-source.type.ts
@@ -0,0 +1,4 @@
+export enum MessageSuppressionSource {
+ WEBHOOK = 'WEBHOOK',
+ SYSTEM = 'SYSTEM',
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/raw-campaign-recipient.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/raw-campaign-recipient.type.ts
new file mode 100644
index 00000000000..d2632b290b5
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/raw-campaign-recipient.type.ts
@@ -0,0 +1,4 @@
+export type RawCampaignRecipient = {
+ personId: string;
+ email: string | null;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/send-campaign-email-job-data.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/send-campaign-email-job-data.type.ts
new file mode 100644
index 00000000000..56283acf10c
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/send-campaign-email-job-data.type.ts
@@ -0,0 +1,8 @@
+export type SendCampaignEmailJobData = {
+ workspaceId: string;
+ campaignId: string;
+ messageId: string;
+ personId: string;
+ recipientEmail: string;
+ emailingDomainId: string;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/topic-opt-out-state.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/topic-opt-out-state.type.ts
new file mode 100644
index 00000000000..127bb3ac5e4
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/topic-opt-out-state.type.ts
@@ -0,0 +1,5 @@
+export type TopicOptOutState = {
+ unsubscribeTopicId: string;
+ topicName: string | null;
+ optedOut: boolean;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-content.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-content.type.ts
new file mode 100644
index 00000000000..c5bef1494b4
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-content.type.ts
@@ -0,0 +1,7 @@
+import { type EmailingDomainHeader } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-header.type';
+
+export type UnsubscribeContent = {
+ headers: EmailingDomainHeader[];
+ textFooter: string;
+ htmlFooter: string;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-token-payload.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-token-payload.type.ts
new file mode 100644
index 00000000000..9dd4c009d85
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-token-payload.type.ts
@@ -0,0 +1,7 @@
+export type UnsubscribeTokenPayload = {
+ workspaceId: string;
+ emailAddress: string;
+ unsubscribeTopicId?: string;
+ preview?: boolean;
+ issuedAt: number;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-topic-visibility.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-topic-visibility.type.ts
new file mode 100644
index 00000000000..2441301672a
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-topic-visibility.type.ts
@@ -0,0 +1,4 @@
+export enum UnsubscribeTopicVisibility {
+ PUBLIC = 'PUBLIC',
+ PRIVATE = 'PRIVATE',
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-urls.type.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-urls.type.ts
new file mode 100644
index 00000000000..ee9555197c0
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/types/unsubscribe-urls.type.ts
@@ -0,0 +1,4 @@
+export type UnsubscribeUrls = {
+ httpsUrl: string;
+ mailtoUrl: string;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/unsubscribe-topic.entity.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/unsubscribe-topic.entity.ts
new file mode 100644
index 00000000000..b813c1a96af
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/unsubscribe-topic.entity.ts
@@ -0,0 +1,38 @@
+import {
+ Column,
+ CreateDateColumn,
+ Entity,
+ Index,
+ PrimaryGeneratedColumn,
+ UpdateDateColumn,
+} from 'typeorm';
+
+import { UnsubscribeTopicVisibility } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-topic-visibility.type';
+import { WorkspaceRelatedEntity } from 'src/engine/workspace-manager/types/workspace-related-entity';
+
+@Entity({ name: 'unsubscribeTopic', schema: 'core' })
+@Index('IDX_UNSUBSCRIBE_TOPIC_WORKSPACE_ID', ['workspaceId'])
+export class UnsubscribeTopicEntity extends WorkspaceRelatedEntity {
+ @PrimaryGeneratedColumn('uuid')
+ id: string;
+
+ @CreateDateColumn({ type: 'timestamptz' })
+ createdAt: Date;
+
+ @UpdateDateColumn({ type: 'timestamptz' })
+ updatedAt: Date;
+
+ @Column({ type: 'varchar', nullable: true })
+ name: string | null;
+
+ @Column({ type: 'varchar', nullable: true })
+ description: string | null;
+
+ @Column({
+ type: 'enum',
+ enum: Object.values(UnsubscribeTopicVisibility),
+ default: UnsubscribeTopicVisibility.PRIVATE,
+ nullable: false,
+ })
+ visibility: UnsubscribeTopicVisibility;
+}
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/__tests__/normalize-campaign-recipients.util.spec.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/__tests__/normalize-campaign-recipients.util.spec.ts
new file mode 100644
index 00000000000..581ecfcda4e
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/__tests__/normalize-campaign-recipients.util.spec.ts
@@ -0,0 +1,49 @@
+import { type RawCampaignRecipient } from 'src/engine/core-modules/emailing-domain/types/raw-campaign-recipient.type';
+import { normalizeCampaignRecipients } from 'src/engine/core-modules/emailing-domain/utils/normalize-campaign-recipients.util';
+
+describe('normalizeCampaignRecipients', () => {
+ it('drops people with no email and reports them', () => {
+ const raw: RawCampaignRecipient[] = [
+ { personId: 'p1', email: '[email protected]' },
+ { personId: 'p2', email: null },
+ { personId: 'p3', email: ' ' },
+ ];
+
+ const { recipients, skipped } = normalizeCampaignRecipients(raw, 100);
+
+ expect(recipients).toEqual([{ personId: 'p1', email: '[email protected]' }]);
+ expect(skipped).toEqual({ noEmail: 2, deduped: 0, overCap: 0 });
+ });
+
+ it('dedupes by lowercased email, keeping the first occurrence', () => {
+ const raw: RawCampaignRecipient[] = [
+ { personId: 'p1', email: '[email protected]' },
+ { personId: 'p2', email: '[email protected]' },
+ ];
+
+ const { recipients, skipped } = normalizeCampaignRecipients(raw, 100);
+
+ expect(recipients).toEqual([{ personId: 'p1', email: '[email protected]' }]);
+ expect(skipped.deduped).toBe(1);
+ });
+
+ it('caps the recipient count and reports the overflow', () => {
+ const raw: RawCampaignRecipient[] = [
+ { personId: 'p1', email: '[email protected]' },
+ { personId: 'p2', email: '[email protected]' },
+ { personId: 'p3', email: '[email protected]' },
+ ];
+
+ const { recipients, skipped } = normalizeCampaignRecipients(raw, 2);
+
+ expect(recipients).toHaveLength(2);
+ expect(skipped.overCap).toBe(1);
+ });
+
+ it('returns an empty result for no input', () => {
+ expect(normalizeCampaignRecipients([], 100)).toEqual({
+ recipients: [],
+ skipped: { noEmail: 0, deduped: 0, overCap: 0 },
+ });
+ });
+});
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-headers.util.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-headers.util.ts
new file mode 100644
index 00000000000..fd5f8c6839f
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-headers.util.ts
@@ -0,0 +1,10 @@
+import { type EmailingDomainHeader } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-header.type';
+import { type UnsubscribeUrls } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-urls.type';
+
+export const buildUnsubscribeHeaders = ({
+ httpsUrl,
+ mailtoUrl,
+}: UnsubscribeUrls): EmailingDomainHeader[] => [
+ { name: 'List-Unsubscribe', value: `<${httpsUrl}>, <${mailtoUrl}>` },
+ { name: 'List-Unsubscribe-Post', value: 'List-Unsubscribe=One-Click' },
+];
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-html-footer.util.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-html-footer.util.ts
new file mode 100644
index 00000000000..9b4cbfb2a64
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-html-footer.util.ts
@@ -0,0 +1,2 @@
+export const buildUnsubscribeHtmlFooter = (httpsUrl: string): string =>
+ `<hr style="margin-top:24px;border:none;border-top:1px solid #eee" /><p style="font-size:12px;color:#888">Don't want these emails? <a href="${httpsUrl}">Unsubscribe</a>.</p>`;
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-preferences-page.util.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-preferences-page.util.ts
new file mode 100644
index 00000000000..5aac231389e
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-preferences-page.util.ts
@@ -0,0 +1,39 @@
+import { type TopicOptOutState } from 'src/engine/core-modules/emailing-domain/types/topic-opt-out-state.type';
+import { escapeHtml } from 'src/engine/core-modules/emailing-domain/utils/escape-html.util';
+
+type BuildUnsubscribePreferencesPageArgs = {
+ token: string;
+ topics: TopicOptOutState[];
+ updatePath: string;
+ unsubscribeAllPath: string;
+};
+
+const PAGE_STYLE = `body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#fafafa;margin:0;padding:48px 16px;color:#1a1a1a}.card{max-width:420px;margin:0 auto;background:#fff;border:1px solid #ededed;border-radius:16px;padding:40px 32px;text-align:center}h1{font-size:28px;font-weight:700;margin:0 0 8px}.subtitle{color:#888;margin:0 0 28px}.topics{text-align:left;margin:0 0 28px}.topic{display:flex;align-items:center;gap:12px;padding:10px 0;font-size:16px}.topic input{width:18px;height:18px;accent-color:#1a1a1a}button{width:100%;border-radius:10px;padding:14px;font-size:16px;font-weight:600;cursor:pointer;border:1px solid transparent}.primary{background:#1a1a1a;color:#fff}.divider{color:#aaa;margin:16px 0}.secondary{background:#fff;color:#1a1a1a;border:1px solid #ddd}`;
+
+const buildTopicCheckbox = (topic: TopicOptOutState): string => {
+ const label = escapeHtml(topic.topicName ?? 'Untitled topic');
+ const value = escapeHtml(topic.unsubscribeTopicId);
+ const checkedAttribute = topic.optedOut ? '' : ' checked';
+
+ return `<label class="topic"><input type="checkbox" name="unsubscribeTopicId" value="${value}"${checkedAttribute} />${label}</label>`;
+};
+
+export const buildUnsubscribePreferencesPage = ({
+ token,
+ topics,
+ updatePath,
+ unsubscribeAllPath,
+}: BuildUnsubscribePreferencesPageArgs): string => {
+ const safeToken = escapeHtml(token);
+
+ const updateSection =
+ topics.length > 0
+ ? `<form method="post" action="${updatePath}"><input type="hidden" name="t" value="${safeToken}" /><div class="topics">${topics
+ .map(buildTopicCheckbox)
+ .join(
+ '',
+ )}</div><button type="submit" class="primary">Update</button></form><p class="divider">Or</p>`
+ : '';
+
+ return `<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>Email preferences</title><style>${PAGE_STYLE}</style></head><body><div class="card"><h1>Do you want to unsubscribe?</h1><p class="subtitle">Confirm your preferences:</p>${updateSection}<form method="post" action="${unsubscribeAllPath}"><input type="hidden" name="t" value="${safeToken}" /><button type="submit" class="secondary">Unsubscribe All</button></form></div></body></html>`;
+};
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-result-page.util.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-result-page.util.ts
new file mode 100644
index 00000000000..2ae341acfce
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-result-page.util.ts
@@ -0,0 +1,13 @@
+import { escapeHtml } from 'src/engine/core-modules/emailing-domain/utils/escape-html.util';
+
+const PAGE_STYLE = `body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;background:#fafafa;margin:0;padding:48px 16px;color:#1a1a1a;text-align:center}.card{max-width:420px;margin:0 auto;background:#fff;border:1px solid #ededed;border-radius:16px;padding:48px 32px}h1{font-size:24px;font-weight:700;margin:0 0 8px}p{color:#888;margin:0}`;
+
+export const buildUnsubscribeResultPage = (
+ title: string,
+ message: string,
+): string =>
+ `<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>${escapeHtml(
+ title,
+ )}</title><style>${PAGE_STYLE}</style></head><body><div class="card"><h1>${escapeHtml(
+ title,
+ )}</h1><p>${escapeHtml(message)}</p></div></body></html>`;
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-text-footer.util.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-text-footer.util.ts
new file mode 100644
index 00000000000..6bcf23481b2
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-text-footer.util.ts
@@ -0,0 +1,2 @@
+export const buildUnsubscribeTextFooter = (httpsUrl: string): string =>
+ `\n\n--\nUnsubscribe: ${httpsUrl}`;
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-urls.util.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-urls.util.ts
new file mode 100644
index 00000000000..b8f268c848f
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/build-unsubscribe-urls.util.ts
@@ -0,0 +1,17 @@
+import { UNSUBSCRIBE_MAILBOX_LOCAL_PART } from 'src/engine/core-modules/emailing-domain/constants/unsubscribe-mailbox.constant';
+import { type UnsubscribeUrls } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-urls.type';
+
+type BuildUnsubscribeUrlsArgs = {
+ unsubscribeHostname: string;
+ domain: string;
+ token: string;
+};
+
+export const buildUnsubscribeUrls = ({
+ unsubscribeHostname,
+ domain,
+ token,
+}: BuildUnsubscribeUrlsArgs): UnsubscribeUrls => ({
+ httpsUrl: `https://${unsubscribeHostname}/emailing/unsubscribe?t=${token}`,
+ mailtoUrl: `mailto:${UNSUBSCRIBE_MAILBOX_LOCAL_PART}@${domain}?subject=${token}`,
+});
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/escape-html.util.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/escape-html.util.ts
new file mode 100644
index 00000000000..5298e6205f4
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/escape-html.util.ts
@@ -0,0 +1,10 @@
+const HTML_ESCAPES: Record<string, string> = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#39;',
+};
+
+export const escapeHtml = (value: string): string =>
+ value.replace(/[&<>"']/g, (character) => HTML_ESCAPES[character]);
diff --git a/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/normalize-campaign-recipients.util.ts b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/normalize-campaign-recipients.util.ts
new file mode 100644
index 00000000000..580c76c805c
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/emailing-domain/utils/normalize-campaign-recipients.util.ts
@@ -0,0 +1,43 @@
+import { isNonEmptyString } from '@sniptt/guards';
+
+import { type CampaignRecipient } from 'src/engine/core-modules/emailing-domain/types/campaign-recipient.type';
+import { type CampaignSkippedBreakdown } from 'src/engine/core-modules/emailing-domain/types/campaign-skipped-breakdown.type';
+import { type RawCampaignRecipient } from 'src/engine/core-modules/emailing-domain/types/raw-campaign-recipient.type';
+
+export const normalizeCampaignRecipients = (
+ rawRecipients: RawCampaignRecipient[],
+ maxRecipients: number,
+): { recipients: CampaignRecipient[]; skipped: CampaignSkippedBreakdown } => {
+ const skipped: CampaignSkippedBreakdown = {
+ noEmail: 0,
+ deduped: 0,
+ overCap: 0,
+ };
+ const seenEmails = new Set<string>();
+ const recipients: CampaignRecipient[] = [];
+
+ for (const candidate of rawRecipients) {
+ const normalizedEmail = candidate.email?.trim().toLowerCase();
+
+ if (!isNonEmptyString(normalizedEmail)) {
+ skipped.noEmail += 1;
+ continue;
+ }
+
+ if (seenEmails.has(normalizedEmail)) {
+ skipped.deduped += 1;
+ continue;
+ }
+
+ seenEmails.add(normalizedEmail);
+
+ if (recipients.length >= maxRecipients) {
+ skipped.overCap += 1;
+ continue;
+ }
+
+ recipients.push({ email: normalizedEmail, personId: candidate.personId });
+ }
+
+ return { recipients, skipped };
+};
diff --git a/packages/twenty-server/src/engine/core-modules/message-queue/jobs.module.ts b/packages/twenty-server/src/engine/core-modules/message-queue/jobs.module.ts
index 8b25db38a22..f1b0c88a203 100644
--- a/packages/twenty-server/src/engine/core-modules/message-queue/jobs.module.ts
+++ b/packages/twenty-server/src/engine/core-modules/message-queue/jobs.module.ts
@@ -12,7 +12,9 @@ import { UpdateSubscriptionQuantityJob } from 'src/engine/core-modules/billing/j
import { StripeModule } from 'src/engine/core-modules/billing/stripe/stripe.module';
import { EmailSenderJob } from 'src/engine/core-modules/email/email-sender.job';
import { EmailModule } from 'src/engine/core-modules/email/email.module';
-import { EmailingDomainModule } from 'src/engine/core-modules/emailing-domain/emailing-domain.module';
+import { EmailingModule } from 'src/modules/emailing/emailing.module';
+import { MaterializeCampaignJob } from 'src/modules/emailing/jobs/materialize-campaign.job';
+import { SendCampaignEmailJob } from 'src/modules/emailing/jobs/send-campaign-email.job';
import { EnterpriseModule } from 'src/engine/core-modules/enterprise/enterprise.module';
import { EventLogIngestionModule } from 'src/engine/core-modules/event-logs/ingest/event-log-ingestion.module';
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
@@ -80,12 +82,14 @@ import { WorkflowModule } from 'src/modules/workflow/workflow.module';
AiChatModule,
LogicFunctionModule,
EnterpriseModule,
- EmailingDomainModule,
+ EmailingModule,
],
providers: [
CleanSuspendedWorkspacesJob,
CleanOnboardingWorkspacesJob,
EmailSenderJob,
+ SendCampaignEmailJob,
+ MaterializeCampaignJob,
UpdateSubscriptionQuantityJob,
HandleWorkspaceMemberDeletedJob,
CleanWorkspaceDeletionWarningUserVarsJob,
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhooks.module.ts b/packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhooks.module.ts
deleted file mode 100644
index d53fc692807..00000000000
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhooks.module.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-import { Module } from '@nestjs/common';
-
-import { EmailingDomainModule } from 'src/engine/core-modules/emailing-domain/emailing-domain.module';
-import { MessagingWebhooksController } from 'src/engine/core-modules/messaging-webhooks/messaging-webhooks.controller';
-import { SesInboundMailHandlerService } from 'src/engine/core-modules/messaging-webhooks/services/ses-inbound-mail-handler.service';
-import { SesInboundWebhookRouterService } from 'src/engine/core-modules/messaging-webhooks/services/ses-inbound-webhook-router.service';
-import { SesOutboundSendingStateHandlerService } from 'src/engine/core-modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service';
-import { SesOutboundWebhookRouterService } from 'src/engine/core-modules/messaging-webhooks/services/ses-outbound-webhook-router.service';
-import { SnsSignatureVerifierService } from 'src/engine/core-modules/messaging-webhooks/services/sns-signature-verifier.service';
-import { SnsSubscriptionConfirmerService } from 'src/engine/core-modules/messaging-webhooks/services/sns-subscription-confirmer.service';
-import { TwentyConfigModule } from 'src/engine/core-modules/twenty-config/twenty-config.module';
-
-@Module({
- imports: [TwentyConfigModule, EmailingDomainModule],
- controllers: [MessagingWebhooksController],
- providers: [
- SnsSignatureVerifierService,
- SnsSubscriptionConfirmerService,
- SesInboundMailHandlerService,
- SesOutboundSendingStateHandlerService,
- SesInboundWebhookRouterService,
- SesOutboundWebhookRouterService,
- ],
-})
-export class MessagingWebhooksModule {}
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/types/ses-event-bridge-notification.type.ts b/packages/twenty-server/src/engine/core-modules/messaging-webhooks/types/ses-event-bridge-notification.type.ts
deleted file mode 100644
index d2b7dbb553b..00000000000
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/types/ses-event-bridge-notification.type.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-export type SesEventBridgeNotification = {
- source: 'aws.ses';
- 'detail-type': 'Sending Status Enabled' | 'Sending Status Disabled';
- resources?: string[];
- detail?: {
- version?: string;
- data?: {
- origin?: string;
- record?: {
- status?: 'ENABLED' | 'DISABLED';
- cause?: string;
- };
- };
- };
-};
diff --git a/packages/twenty-server/src/engine/core-modules/tool/tools/email-tool/email-composer.service.ts b/packages/twenty-server/src/engine/core-modules/tool/tools/email-tool/email-composer.service.ts
index fae761eada0..058aa03f700 100644
--- a/packages/twenty-server/src/engine/core-modules/tool/tools/email-tool/email-composer.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/tool/tools/email-tool/email-composer.service.ts
@@ -362,9 +362,12 @@ export class EmailComposerService {
workspaceId,
);
- const messageChannel = connectedAccount.messageChannels.find(
- (channel) => channel.handle === connectedAccount.handle,
- );
+ const messageChannel =
+ connectedAccount.provider === ConnectedAccountProvider.EMAIL_GROUP
+ ? connectedAccount.messageChannels[0]
+ : connectedAccount.messageChannels.find(
+ (channel) => channel.handle === connectedAccount.handle,
+ );
const isSmtpOnlyAccount =
connectedAccount.provider === ConnectedAccountProvider.IMAP_SMTP_CALDAV &&
diff --git a/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts b/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts
index f2b6ca7b697..1a95bff5420 100644
--- a/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts
+++ b/packages/twenty-server/src/engine/core-modules/twenty-config/config-variables.ts
@@ -1701,12 +1701,12 @@ export class ConfigVariables {
@ConfigVariablesMetadata({
group: ConfigVariablesGroup.AWS_SES_SETTINGS,
description:
- 'Driver used for the emailing domain feature — AWS_SES for production, LOG for local development (no AWS credentials needed)',
+ 'Driver used for the emailing domain feature — AWS_SES for production (requires AWS credentials), LOG fakes registration/verification/sends locally',
type: ConfigVariableType.ENUM,
options: Object.values(EmailingDomainDriver),
})
@CastToUpperSnakeCase()
- EMAILING_DOMAIN_DRIVER: EmailingDomainDriver = EmailingDomainDriver.AWS_SES;
+ EMAILING_DOMAIN_DRIVER: EmailingDomainDriver = EmailingDomainDriver.LOG;
@ConfigVariablesMetadata({
group: ConfigVariablesGroup.AWS_SES_SETTINGS,
diff --git a/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts b/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts
index 72ba4e047e2..85b03b82e07 100644
--- a/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/user-workspace/user-workspace.service.ts
@@ -41,7 +41,7 @@ import { GlobalWorkspaceOrmManager } from 'src/engine/twenty-orm/global-workspac
import { buildSystemAuthContext } from 'src/engine/twenty-orm/utils/build-system-auth-context.util';
import { type WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
import { assert } from 'src/utils/assert';
-import { getDomainNameByEmail } from 'src/utils/get-domain-name-by-email';
+import { getDomainFromEmailOrThrow } from 'src/utils/get-domain-from-email-or-throw';
export class UserWorkspaceService extends TypeOrmQueryService<UserWorkspaceEntity> {
private readonly logger = new Logger(UserWorkspaceService.name);
@@ -357,7 +357,7 @@ export class UserWorkspaceService extends TypeOrmQueryService<UserWorkspaceEntit
const workspacesFromApprovedAccessDomain = (
await this.approvedAccessDomainService.findValidatedApprovedAccessDomainWithWorkspacesAndSSOIdentityProvidersDomain(
- getDomainNameByEmail(email),
+ getDomainFromEmailOrThrow(email),
)
)
.filter(
diff --git a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.ts b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.ts
index c9846e19aeb..204d728c7a5 100644
--- a/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum.ts
@@ -50,6 +50,7 @@ export enum EngineComponentKey {
FRONT_COMPONENT_RENDERER = 'FRONT_COMPONENT_RENDERER',
REPLY_TO_EMAIL_THREAD = 'REPLY_TO_EMAIL_THREAD',
COMPOSE_EMAIL = 'COMPOSE_EMAIL',
+ COMPOSE_CAMPAIGN = 'COMPOSE_CAMPAIGN',
// TODO: Remove deprecated keys once upgrade:1-21:refactor-navigation-commands has run on all workspaces
// Deprecated: replaced by NAVIGATION engine key with payload
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/build-navigation-flat-command-menu-item.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/build-navigation-flat-command-menu-item.util.ts
index d476709076c..c6d763101dc 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/build-navigation-flat-command-menu-item.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-command-menu-item/utils/build-navigation-flat-command-menu-item.util.ts
@@ -23,6 +23,10 @@ const NAVIGATION_FEATURE_FLAG_GATE_BY_OBJECT_UNIVERSAL_IDENTIFIER: Partial<
> = {
[STANDARD_OBJECTS.callRecording.universalIdentifier]:
FeatureFlagKey.IS_CALL_RECORDING_ENABLED,
+ [STANDARD_OBJECTS.messageCampaign.universalIdentifier]:
+ FeatureFlagKey.IS_EMAIL_GROUP_ENABLED,
+ [STANDARD_OBJECTS.messageList.universalIdentifier]:
+ FeatureFlagKey.IS_EMAIL_GROUP_ENABLED,
};
export const buildNavigationConditionalAvailabilityExpression = ({
diff --git a/packages/twenty-server/src/engine/metadata-modules/message-channel/message-channel-metadata.module.ts b/packages/twenty-server/src/engine/metadata-modules/message-channel/message-channel-metadata.module.ts
index 6f370766733..236762fc72b 100644
--- a/packages/twenty-server/src/engine/metadata-modules/message-channel/message-channel-metadata.module.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/message-channel/message-channel-metadata.module.ts
@@ -1,6 +1,7 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
+import { EmailingDomainModule } from 'src/engine/core-modules/emailing-domain/emailing-domain.module';
import { ConnectedAccountMetadataModule } from 'src/engine/metadata-modules/connected-account/connected-account-metadata.module';
import { MessageChannelEntity } from 'src/engine/metadata-modules/message-channel/entities/message-channel.entity';
import { MessageChannelGraphqlApiExceptionInterceptor } from 'src/engine/metadata-modules/message-channel/interceptors/message-channel-graphql-api-exception.interceptor';
@@ -17,6 +18,7 @@ import { MessagingImportManagerModule } from 'src/modules/messaging/message-impo
PermissionsModule,
ConnectedAccountMetadataModule,
MessagingImportManagerModule,
+ EmailingDomainModule,
WorkspaceEventEmitterModule,
],
providers: [
diff --git a/packages/twenty-server/src/engine/metadata-modules/message-channel/message-channel-metadata.service.ts b/packages/twenty-server/src/engine/metadata-modules/message-channel/message-channel-metadata.service.ts
index 2761266c27e..435dbbc5aad 100644
--- a/packages/twenty-server/src/engine/metadata-modules/message-channel/message-channel-metadata.service.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/message-channel/message-channel-metadata.service.ts
@@ -4,6 +4,7 @@ import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { isNonEmptyString } from '@sniptt/guards';
+import { isDefined } from 'twenty-shared/utils';
import { In, Repository } from 'typeorm';
import {
@@ -16,6 +17,8 @@ import {
MessageChannelVisibility,
} from 'twenty-shared/types';
+import { EmailingDomainDriver } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-driver.type';
+import { EmailingDomainService } from 'src/engine/core-modules/emailing-domain/services/emailing-domain.service';
import { StorageDriverType } from 'src/engine/core-modules/file-storage/interfaces/file-storage.interface';
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
import { ConnectedAccountMetadataService } from 'src/engine/metadata-modules/connected-account/connected-account-metadata.service';
@@ -31,6 +34,7 @@ import { type MessageChannelDeletedEvent } from 'src/engine/metadata-modules/mes
import { WorkspaceEventEmitter } from 'src/engine/workspace-event-emitter/workspace-event-emitter';
import { INBOUND_EMAIL_LOCAL_PART_PREFIX } from 'src/modules/messaging/message-import-manager/drivers/inbound-email/constants/inbound-email-local-part-prefix.constant';
import { INBOUND_EMAIL_LOCAL_PART_RANDOM_BYTES } from 'src/modules/messaging/message-import-manager/drivers/inbound-email/constants/inbound-email-local-part-random-bytes.constant';
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
@Injectable()
export class MessageChannelMetadataService {
@@ -39,6 +43,7 @@ export class MessageChannelMetadataService {
private readonly repository: Repository<MessageChannelEntity>,
private readonly connectedAccountMetadataService: ConnectedAccountMetadataService,
private readonly twentyConfigService: TwentyConfigService,
+ private readonly emailingDomainService: EmailingDomainService,
private readonly workspaceEventEmitter: WorkspaceEventEmitter,
) {}
@@ -219,10 +224,14 @@ export class MessageChannelMetadataService {
'INBOUND_EMAIL_DOMAIN',
);
const storageType = this.twentyConfigService.get('STORAGE_TYPE');
+ const isEmailingDomainInDemoMode =
+ this.twentyConfigService.get('EMAILING_DOMAIN_DRIVER') ===
+ EmailingDomainDriver.LOG;
if (
- !isNonEmptyString(inboundEmailDomain) ||
- storageType !== StorageDriverType.S_3
+ !isEmailingDomainInDemoMode &&
+ (!isNonEmptyString(inboundEmailDomain) ||
+ storageType !== StorageDriverType.S_3)
) {
throw new MessageChannelException(
'Email handles are not configured: INBOUND_EMAIL_DOMAIN must be set and STORAGE_TYPE must be S3',
@@ -230,11 +239,24 @@ export class MessageChannelMetadataService {
);
}
+ const sendDomain = getDomainFromEmail(handle)?.toLowerCase();
+
+ if (isNonEmptyString(sendDomain)) {
+ await this.emailingDomainService.ensureEmailingDomain(
+ sendDomain,
+ workspaceId,
+ );
+ }
+
const localPart =
INBOUND_EMAIL_LOCAL_PART_PREFIX +
randomBytes(INBOUND_EMAIL_LOCAL_PART_RANDOM_BYTES).toString('hex');
- const forwardingAddress = `${localPart}@${inboundEmailDomain}`;
+ const forwardingDomain = isNonEmptyString(inboundEmailDomain)
+ ? inboundEmailDomain
+ : 'demo.invalid';
+
+ const forwardingAddress = `${localPart}@${forwardingDomain}`;
const connectedAccount = await this.connectedAccountMetadataService.create({
workspaceId,
@@ -266,6 +288,36 @@ export class MessageChannelMetadataService {
return { messageChannel, forwardingAddress };
}
+ async getOrCreateEmailGroupChannel({
+ fromAddress,
+ userWorkspaceId,
+ workspaceId,
+ }: {
+ fromAddress: string;
+ userWorkspaceId: string;
+ workspaceId: string;
+ }): Promise<MessageChannelDTO> {
+ const existingChannel = await this.repository.findOne({
+ where: {
+ workspaceId,
+ type: MessageChannelType.EMAIL_GROUP,
+ connectedAccount: { handle: fromAddress },
+ },
+ });
+
+ if (existingChannel) {
+ return existingChannel;
+ }
+
+ const { messageChannel } = await this.createEmailGroupChannel({
+ handle: fromAddress,
+ userWorkspaceId,
+ workspaceId,
+ });
+
+ return messageChannel;
+ }
+
async delete({
id,
workspaceId,
@@ -287,4 +339,70 @@ export class MessageChannelMetadataService {
return messageChannel;
}
+
+ async deleteEmailGroupChannel({
+ id,
+ userWorkspaceId,
+ workspaceId,
+ }: {
+ id: string;
+ userWorkspaceId: string;
+ workspaceId: string;
+ }): Promise<MessageChannelDTO> {
+ const messageChannel = await this.verifyOwnership({
+ id,
+ userWorkspaceId,
+ workspaceId,
+ });
+
+ if (messageChannel.type !== MessageChannelType.EMAIL_GROUP) {
+ throw new MessageChannelException(
+ `Message channel ${id} is not an email group`,
+ MessageChannelExceptionCode.INVALID_MESSAGE_CHANNEL_INPUT,
+ );
+ }
+
+ const connectedAccount =
+ await this.connectedAccountMetadataService.findById({
+ id: messageChannel.connectedAccountId,
+ workspaceId,
+ });
+ const sendDomain = getDomainFromEmail(
+ connectedAccount?.handle ?? '',
+ )?.toLowerCase();
+
+ await this.connectedAccountMetadataService.delete({
+ id: messageChannel.connectedAccountId,
+ workspaceId,
+ });
+
+ if (
+ isNonEmptyString(sendDomain) &&
+ !(await this.hasEmailGroupChannelForDomain(workspaceId, sendDomain))
+ ) {
+ await this.emailingDomainService.deleteEmailingDomainByDomainIfExists(
+ workspaceId,
+ sendDomain,
+ );
+ }
+
+ return messageChannel;
+ }
+
+ private async hasEmailGroupChannelForDomain(
+ workspaceId: string,
+ domain: string,
+ ): Promise<boolean> {
+ const emailGroupChannels = await this.repository.find({
+ where: { workspaceId, type: MessageChannelType.EMAIL_GROUP },
+ relations: { connectedAccount: true },
+ });
+
+ return emailGroupChannels.some(
+ (channel) =>
+ isDefined(channel.connectedAccount) &&
+ getDomainFromEmail(channel.connectedAccount.handle)?.toLowerCase() ===
+ domain,
+ );
+ }
}
diff --git a/packages/twenty-server/src/engine/metadata-modules/message-channel/resolvers/message-channel.resolver.ts b/packages/twenty-server/src/engine/metadata-modules/message-channel/resolvers/message-channel.resolver.ts
index e90a7368b5b..76dcdb653ae 100644
--- a/packages/twenty-server/src/engine/metadata-modules/message-channel/resolvers/message-channel.resolver.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/message-channel/resolvers/message-channel.resolver.ts
@@ -186,25 +186,10 @@ export class MessageChannelResolver {
@AuthWorkspace() workspace: WorkspaceEntity,
@AuthUserWorkspaceId() userWorkspaceId: string,
): Promise<MessageChannelDTO> {
- const messageChannel =
- await this.messageChannelMetadataService.verifyOwnership({
- id,
- userWorkspaceId,
- workspaceId: workspace.id,
- });
-
- if (messageChannel.type !== MessageChannelType.EMAIL_GROUP) {
- throw new MessageChannelException(
- `Message channel ${id} is not an email group`,
- MessageChannelExceptionCode.INVALID_MESSAGE_CHANNEL_INPUT,
- );
- }
-
- await this.connectedAccountMetadataService.delete({
- id: messageChannel.connectedAccountId,
+ return this.messageChannelMetadataService.deleteEmailGroupChannel({
+ id,
+ userWorkspaceId,
workspaceId: workspace.id,
});
-
- return messageChannel;
}
}
diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/constants/message-channel-seed-ids.constant.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/constants/message-channel-seed-ids.constant.ts
index c5d67b4b120..3ed8209a7dd 100644
--- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/constants/message-channel-seed-ids.constant.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/constants/message-channel-seed-ids.constant.ts
@@ -5,4 +5,6 @@ export const MESSAGE_CHANNEL_DATA_SEED_IDS = {
JANE: '20202020-8c4d-4e71-a672-2e6a8c9f1b3d',
SUPPORT: '20202020-e2f1-49b5-85d2-5d3a3386990d',
SALES: '20202020-e2f1-49b5-85d2-5d3a3386990e',
+ SUPPORT_GROUP: '20202020-5a1e-4b2c-9d3e-200000000001',
+ CONTACT_GROUP: '20202020-5a1e-4b2c-9d3e-200000000002',
} as const;
diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-emailing-domains.util.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-emailing-domains.util.ts
index c9be6989a4c..7ff96a8f5a3 100644
--- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-emailing-domains.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-emailing-domains.util.ts
@@ -7,6 +7,15 @@ const tableName = 'emailingDomain';
const DEV_EMAILING_DOMAIN = 'dev.twenty.local';
+export const getSeededEmailGroupDomains = (workspaceId: string) => {
+ const prefix = workspaceId.slice(0, 8);
+
+ return {
+ verified: `${prefix}.${DEV_EMAILING_DOMAIN}`,
+ pending: `${prefix}.pending.${DEV_EMAILING_DOMAIN}`,
+ };
+};
+
type SeedEmailingDomainsArgs = {
queryRunner: QueryRunner;
schemaName: string;
@@ -18,7 +27,7 @@ export const seedEmailingDomains = async ({
schemaName,
workspaceId,
}: SeedEmailingDomainsArgs) => {
- const domain = `${workspaceId.slice(0, 8)}.${DEV_EMAILING_DOMAIN}`;
+ const { verified, pending } = getSeededEmailGroupDomains(workspaceId);
await queryRunner.manager
.createQueryBuilder()
@@ -35,12 +44,31 @@ export const seedEmailingDomains = async ({
.values([
{
workspaceId,
- domain,
+ domain: verified,
status: EmailingDomainStatus.VERIFIED,
- verificationRecords: JSON.stringify([]),
+ verificationRecords: [],
verifiedAt: new Date(),
tenantStatus: EmailingDomainTenantStatus.ACTIVE,
},
+ {
+ workspaceId,
+ domain: pending,
+ status: EmailingDomainStatus.PENDING,
+ verificationRecords: [
+ {
+ type: 'TXT',
+ key: `_amazonses.${pending}`,
+ value: 'seed-verification-token',
+ },
+ {
+ type: 'CNAME',
+ key: `seed1._domainkey.${pending}`,
+ value: 'seed1.dkim.amazonses.com',
+ },
+ ],
+ verifiedAt: null,
+ tenantStatus: EmailingDomainTenantStatus.ACTIVE,
+ },
])
.execute();
};
diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-metadata-entities.util.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-metadata-entities.util.ts
index f5dcb0a69c6..cc1f3c1092a 100644
--- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-metadata-entities.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/core/utils/seed-metadata-entities.util.ts
@@ -16,6 +16,8 @@ import { USER_WORKSPACE_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-s
import { CALENDAR_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/core/constants/calendar-channel-seed-ids.constant';
import { MESSAGE_CHANNEL_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/core/constants/message-channel-seed-ids.constant';
import { MESSAGE_FOLDER_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/core/constants/message-folder-seed-ids.constant';
+import { UnsubscribeTopicVisibility } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-topic-visibility.type';
+import { getSeededEmailGroupDomains } from 'src/engine/workspace-manager/dev-seeder/core/utils/seed-emailing-domains.util';
import { CONNECTED_ACCOUNT_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/connected-account-data-seeds.constant';
type SeedMetadataEntitiesArgs = {
@@ -31,6 +33,8 @@ const YC_CONNECTED_ACCOUNT_IDS = {
PHIL: '30303030-cafc-4323-908d-e5b42ad69fdf',
JANE: '30303030-b5c7-46f0-bf5c-3f4e4b3f7c1a',
JANE_DELETABLE: '30303030-d1e5-4a8f-9c3b-7f6d5e4c3b2a',
+ SUPPORT_GROUP: '30303030-5a1e-4b2c-9d3e-100000000001',
+ CONTACT_GROUP: '30303030-5a1e-4b2c-9d3e-100000000002',
};
const YC_MESSAGE_CHANNEL_IDS = {
@@ -40,6 +44,8 @@ const YC_MESSAGE_CHANNEL_IDS = {
JANE: '30303030-8c4d-4e71-a672-2e6a8c9f1b3d',
SUPPORT: '30303030-e2f1-49b5-85d2-5d3a3386990d',
SALES: '30303030-e2f1-49b5-85d2-5d3a3386990e',
+ SUPPORT_GROUP: '30303030-5a1e-4b2c-9d3e-200000000001',
+ CONTACT_GROUP: '30303030-5a1e-4b2c-9d3e-200000000002',
} as const;
const YC_CALENDAR_CHANNEL_IDS = {
@@ -59,6 +65,18 @@ const YC_MESSAGE_FOLDER_IDS = {
JANE_SENT: '30303030-1234-4567-8901-abcdef012348',
} as const;
+const APPLE_UNSUBSCRIBE_TOPIC_IDS = {
+ PRODUCT_UPDATES: '20202020-7b1c-4a2d-8e3f-300000000001',
+ NEWSLETTER: '20202020-7b1c-4a2d-8e3f-300000000002',
+ TRANSACTIONAL: '20202020-7b1c-4a2d-8e3f-300000000003',
+} as const;
+
+const YC_UNSUBSCRIBE_TOPIC_IDS = {
+ PRODUCT_UPDATES: '30303030-7b1c-4a2d-8e3f-300000000001',
+ NEWSLETTER: '30303030-7b1c-4a2d-8e3f-300000000002',
+ TRANSACTIONAL: '30303030-7b1c-4a2d-8e3f-300000000003',
+} as const;
+
const getSeedIds = (workspaceId: string) => {
if (workspaceId === SEED_YCOMBINATOR_WORKSPACE_ID) {
return {
@@ -72,6 +90,7 @@ const getSeedIds = (workspaceId: string) => {
messageChannelIds: YC_MESSAGE_CHANNEL_IDS,
calendarChannelIds: YC_CALENDAR_CHANNEL_IDS,
messageFolderIds: YC_MESSAGE_FOLDER_IDS,
+ unsubscribeTopicIds: YC_UNSUBSCRIBE_TOPIC_IDS,
};
}
@@ -86,6 +105,7 @@ const getSeedIds = (workspaceId: string) => {
messageChannelIds: MESSAGE_CHANNEL_DATA_SEED_IDS,
calendarChannelIds: CALENDAR_CHANNEL_DATA_SEED_IDS,
messageFolderIds: MESSAGE_FOLDER_DATA_SEED_IDS,
+ unsubscribeTopicIds: APPLE_UNSUBSCRIBE_TOPIC_IDS,
};
};
@@ -103,6 +123,7 @@ export const seedMetadataEntities = async ({
await seedConnectedAccounts({ queryRunner, schemaName, workspaceId });
await seedMessageChannels({ queryRunner, schemaName, workspaceId });
+ await seedUnsubscribeTopics({ queryRunner, schemaName, workspaceId });
await seedCalendarChannels({ queryRunner, schemaName, workspaceId });
await seedMessageFolders({ queryRunner, schemaName, workspaceId });
};
@@ -113,6 +134,7 @@ const seedConnectedAccounts = async ({
workspaceId,
}: SeedMetadataEntitiesArgs) => {
const ids = getSeedIds(workspaceId);
+ const emailGroupDomains = getSeededEmailGroupDomains(workspaceId);
const connectedAccounts = [
{
@@ -150,6 +172,20 @@ const seedConnectedAccounts = async ({
userWorkspaceId: ids.userWorkspaceIds.JANE,
workspaceId,
},
+ {
+ id: ids.connectedAccountIds.SUPPORT_GROUP,
+ handle: `support@${emailGroupDomains.verified}`,
+ provider: 'email_group',
+ userWorkspaceId: ids.userWorkspaceIds.TIM,
+ workspaceId,
+ },
+ {
+ id: ids.connectedAccountIds.CONTACT_GROUP,
+ handle: `contact@${emailGroupDomains.pending}`,
+ provider: 'email_group',
+ userWorkspaceId: ids.userWorkspaceIds.TIM,
+ workspaceId,
+ },
];
await queryRunner.manager
@@ -271,6 +307,38 @@ const seedMessageChannels = async ({
connectedAccountId: ids.connectedAccountIds.TIM,
workspaceId,
},
+ {
+ id: ids.messageChannelIds.SUPPORT_GROUP,
+ handle: '[email protected]',
+ visibility: MessageChannelVisibility.SHARE_EVERYTHING,
+ type: MessageChannelType.EMAIL_GROUP,
+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,
+ isContactAutoCreationEnabled: true,
+ contactAutoCreationPolicy: 'SENT_AND_RECEIVED',
+ messageFolderImportPolicy: 'ALL_FOLDERS',
+ excludeNonProfessionalEmails: false,
+ excludeGroupEmails: false,
+ pendingGroupEmailsAction: 'NONE',
+ isSyncEnabled: true,
+ connectedAccountId: ids.connectedAccountIds.SUPPORT_GROUP,
+ workspaceId,
+ },
+ {
+ id: ids.messageChannelIds.CONTACT_GROUP,
+ handle: '[email protected]',
+ visibility: MessageChannelVisibility.SHARE_EVERYTHING,
+ type: MessageChannelType.EMAIL_GROUP,
+ syncStage: MessageChannelSyncStage.MESSAGE_LIST_FETCH_PENDING,
+ isContactAutoCreationEnabled: true,
+ contactAutoCreationPolicy: 'SENT_AND_RECEIVED',
+ messageFolderImportPolicy: 'ALL_FOLDERS',
+ excludeNonProfessionalEmails: false,
+ excludeGroupEmails: false,
+ pendingGroupEmailsAction: 'NONE',
+ isSyncEnabled: true,
+ connectedAccountId: ids.connectedAccountIds.CONTACT_GROUP,
+ workspaceId,
+ },
];
await queryRunner.manager
@@ -297,6 +365,52 @@ const seedMessageChannels = async ({
.execute();
};
+const seedUnsubscribeTopics = async ({
+ queryRunner,
+ schemaName,
+ workspaceId,
+}: SeedMetadataEntitiesArgs) => {
+ const ids = getSeedIds(workspaceId);
+
+ const unsubscribeTopics = [
+ {
+ id: ids.unsubscribeTopicIds.PRODUCT_UPDATES,
+ name: 'Product updates',
+ description: 'New features and product announcements.',
+ visibility: UnsubscribeTopicVisibility.PUBLIC,
+ workspaceId,
+ },
+ {
+ id: ids.unsubscribeTopicIds.NEWSLETTER,
+ name: 'Newsletter',
+ description: 'Our periodic company newsletter.',
+ visibility: UnsubscribeTopicVisibility.PUBLIC,
+ workspaceId,
+ },
+ {
+ id: ids.unsubscribeTopicIds.TRANSACTIONAL,
+ name: 'Transactional',
+ description: 'Internal-only category, hidden from the preferences page.',
+ visibility: UnsubscribeTopicVisibility.PRIVATE,
+ workspaceId,
+ },
+ ];
+
+ await queryRunner.manager
+ .createQueryBuilder()
+ .insert()
+ .into(`${schemaName}.unsubscribeTopic`, [
+ 'id',
+ 'name',
+ 'description',
+ 'visibility',
+ 'workspaceId',
+ ])
+ .orIgnore()
+ .values(unsubscribeTopics)
+ .execute();
+};
+
const seedCalendarChannels = async ({
queryRunner,
schemaName,
diff --git a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/data/constants/connected-account-data-seeds.constant.ts b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/data/constants/connected-account-data-seeds.constant.ts
index ad47f8e9a0f..4df39dd4aa1 100644
--- a/packages/twenty-server/src/engine/workspace-manager/dev-seeder/data/constants/connected-account-data-seeds.constant.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/dev-seeder/data/constants/connected-account-data-seeds.constant.ts
@@ -33,6 +33,8 @@ export const CONNECTED_ACCOUNT_DATA_SEED_IDS = {
PHIL: '20202020-cafc-4323-908d-e5b42ad69fdf',
JANE: '20202020-b5c7-46f0-bf5c-3f4e4b3f7c1a',
JANE_DELETABLE: '20202020-d1e5-4a8f-9c3b-7f6d5e4c3b2a',
+ SUPPORT_GROUP: '20202020-5a1e-4b2c-9d3e-100000000001',
+ CONTACT_GROUP: '20202020-5a1e-4b2c-9d3e-100000000002',
};
export const CONNECTED_ACCOUNT_DATA_SEEDS: ConnectedAccountDataSeed[] = [
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts
index 1bd69672f8a..5194ef40388 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-command-menu-item.constant.ts
@@ -709,6 +709,36 @@ export const STANDARD_COMMAND_MENU_ITEMS = {
engineComponentKey: EngineComponentKey.COMPOSE_EMAIL,
hotKeys: null,
},
+ composeCampaign: {
+ universalIdentifier: '30473656-e7cb-42e0-b198-6c4e8b906106',
+ label: 'Compose Campaign',
+ icon: 'IconSend',
+ isPinned: false,
+ position: 66,
+ shortLabel: 'Campaign',
+ availabilityType: CommandMenuItemAvailabilityType.GLOBAL,
+ conditionalAvailabilityExpression: 'featureFlags.IS_EMAIL_GROUP_ENABLED',
+ availabilityObjectMetadataUniversalIdentifier: null,
+ frontComponentUniversalIdentifier: null,
+ engineComponentKey: EngineComponentKey.COMPOSE_CAMPAIGN,
+ hotKeys: null,
+ },
+ composeCampaignPinned: {
+ universalIdentifier: '7ad6f0c7-ac02-4062-b5cf-1f36e1664bc8',
+ label: 'Compose Campaign',
+ icon: 'IconSend',
+ isPinned: true,
+ position: 67,
+ shortLabel: 'Campaign',
+ availabilityType: CommandMenuItemAvailabilityType.GLOBAL_OBJECT_CONTEXT,
+ conditionalAvailabilityExpression:
+ 'pageType == "INDEX_PAGE" and featureFlags.IS_EMAIL_GROUP_ENABLED',
+ availabilityObjectMetadataUniversalIdentifier:
+ STANDARD_OBJECTS.messageCampaign.universalIdentifier,
+ frontComponentUniversalIdentifier: null,
+ engineComponentKey: EngineComponentKey.COMPOSE_CAMPAIGN,
+ hotKeys: null,
+ },
goToSettings: {
universalIdentifier: 'ef9aba44-0068-453e-930a-f8c182af18ee',
label: 'Go to Settings',
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template.ts
index f49c7eed2e6..c030ccd4236 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template.ts
@@ -85,6 +85,10 @@ export const VERTICAL_LIST_LAYOUT_POSITIONS = {
layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
index: 3,
},
+ FIFTH: {
+ layoutMode: PageLayoutTabLayoutMode.VERTICAL_LIST,
+ index: 4,
+ },
} as const satisfies Record<string, PageLayoutWidgetVerticalListPosition>;
export const CANVAS_LAYOUT_POSITIONS = {
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout.constant.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout.constant.ts
index 2b2a68ac742..3742efaa7dc 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout.constant.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout.constant.ts
@@ -5,9 +5,11 @@ import {
STANDARD_CALL_RECORDING_PAGE_LAYOUT_CONFIG,
STANDARD_COMPANY_PAGE_LAYOUT_CONFIG,
STANDARD_DASHBOARD_PAGE_LAYOUT_CONFIG,
+ STANDARD_MESSAGE_CAMPAIGN_PAGE_LAYOUT_CONFIG,
STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG,
STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_PAGE_LAYOUT_CONFIG,
STANDARD_MESSAGE_PARTICIPANT_PAGE_LAYOUT_CONFIG,
+ STANDARD_MESSAGE_LIST_PAGE_LAYOUT_CONFIG,
STANDARD_MESSAGE_THREAD_PAGE_LAYOUT_CONFIG,
STANDARD_NOTE_PAGE_LAYOUT_CONFIG,
STANDARD_OPPORTUNITY_PAGE_LAYOUT_CONFIG,
@@ -29,11 +31,13 @@ export const STANDARD_PAGE_LAYOUTS = {
STANDARD_CALENDAR_EVENT_PARTICIPANT_PAGE_LAYOUT_CONFIG,
callRecordingRecordPage: STANDARD_CALL_RECORDING_PAGE_LAYOUT_CONFIG,
companyRecordPage: STANDARD_COMPANY_PAGE_LAYOUT_CONFIG,
+ messageCampaignRecordPage: STANDARD_MESSAGE_CAMPAIGN_PAGE_LAYOUT_CONFIG,
messageChannelMessageAssociationRecordPage:
STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_PAGE_LAYOUT_CONFIG,
messageChannelMessageAssociationMessageFolderRecordPage:
STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG,
messageParticipantRecordPage: STANDARD_MESSAGE_PARTICIPANT_PAGE_LAYOUT_CONFIG,
+ messageListRecordPage: STANDARD_MESSAGE_LIST_PAGE_LAYOUT_CONFIG,
messageThreadRecordPage: STANDARD_MESSAGE_THREAD_PAGE_LAYOUT_CONFIG,
noteRecordPage: STANDARD_NOTE_PAGE_LAYOUT_CONFIG,
opportunityRecordPage: STANDARD_OPPORTUNITY_PAGE_LAYOUT_CONFIG,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap
index c8ca5d6a0a0..6ccc45210dc 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-object-metadata-related-entity-ids.util.spec.ts.snap
@@ -850,183 +850,249 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"message": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000357",
+ "id": "00000000-0000-0000-0000-000000000401",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000367",
+ "id": "00000000-0000-0000-0000-000000000413",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000359",
+ "id": "00000000-0000-0000-0000-000000000403",
+ },
+ "deliveryStatus": {
+ "id": "00000000-0000-0000-0000-000000000412",
},
"headerMessageId": {
- "id": "00000000-0000-0000-0000-000000000360",
+ "id": "00000000-0000-0000-0000-000000000404",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000356",
+ "id": "00000000-0000-0000-0000-000000000400",
+ },
+ "messageCampaign": {
+ "id": "00000000-0000-0000-0000-000000000411",
},
"messageChannelMessageAssociations": {
- "id": "00000000-0000-0000-0000-000000000366",
+ "id": "00000000-0000-0000-0000-000000000410",
},
"messageParticipants": {
- "id": "00000000-0000-0000-0000-000000000365",
+ "id": "00000000-0000-0000-0000-000000000409",
},
"messageThread": {
- "id": "00000000-0000-0000-0000-000000000361",
+ "id": "00000000-0000-0000-0000-000000000405",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000369",
+ "id": "00000000-0000-0000-0000-000000000415",
},
"receivedAt": {
- "id": "00000000-0000-0000-0000-000000000364",
+ "id": "00000000-0000-0000-0000-000000000408",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000370",
+ "id": "00000000-0000-0000-0000-000000000416",
},
"subject": {
- "id": "00000000-0000-0000-0000-000000000362",
+ "id": "00000000-0000-0000-0000-000000000406",
},
"text": {
- "id": "00000000-0000-0000-0000-000000000363",
+ "id": "00000000-0000-0000-0000-000000000407",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000358",
+ "id": "00000000-0000-0000-0000-000000000402",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000368",
+ "id": "00000000-0000-0000-0000-000000000414",
},
},
- "id": "00000000-0000-0000-0000-000000000379",
+ "id": "00000000-0000-0000-0000-000000000425",
"views": {
"allMessages": {
- "id": "00000000-0000-0000-0000-000000000378",
+ "id": "00000000-0000-0000-0000-000000000424",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000377",
+ "id": "00000000-0000-0000-0000-000000000423",
},
"headerMessageId": {
- "id": "00000000-0000-0000-0000-000000000375",
+ "id": "00000000-0000-0000-0000-000000000421",
},
"messageParticipants": {
- "id": "00000000-0000-0000-0000-000000000373",
+ "id": "00000000-0000-0000-0000-000000000419",
},
"messageThread": {
- "id": "00000000-0000-0000-0000-000000000372",
+ "id": "00000000-0000-0000-0000-000000000418",
},
"receivedAt": {
- "id": "00000000-0000-0000-0000-000000000374",
+ "id": "00000000-0000-0000-0000-000000000420",
},
"subject": {
- "id": "00000000-0000-0000-0000-000000000371",
+ "id": "00000000-0000-0000-0000-000000000417",
},
"text": {
- "id": "00000000-0000-0000-0000-000000000376",
+ "id": "00000000-0000-0000-0000-000000000422",
},
},
"viewGroups": {},
},
},
},
- "messageChannelMessageAssociation": {
+ "messageCampaign": {
"fields": {
+ "bodyTemplate": {
+ "id": "00000000-0000-0000-0000-000000000262",
+ },
"createdAt": {
"id": "00000000-0000-0000-0000-000000000254",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000263",
+ "id": "00000000-0000-0000-0000-000000000257",
},
"deletedAt": {
"id": "00000000-0000-0000-0000-000000000256",
},
- "direction": {
- "id": "00000000-0000-0000-0000-000000000262",
+ "fromAddress": {
+ "id": "00000000-0000-0000-0000-000000000263",
},
"id": {
"id": "00000000-0000-0000-0000-000000000253",
},
- "message": {
+ "list": {
+ "id": "00000000-0000-0000-0000-000000000267",
+ },
+ "messages": {
+ "id": "00000000-0000-0000-0000-000000000269",
+ },
+ "position": {
+ "id": "00000000-0000-0000-0000-000000000259",
+ },
+ "recipients": {
+ "id": "00000000-0000-0000-0000-000000000270",
+ },
+ "searchVector": {
+ "id": "00000000-0000-0000-0000-000000000260",
+ },
+ "sentAt": {
+ "id": "00000000-0000-0000-0000-000000000265",
+ },
+ "status": {
+ "id": "00000000-0000-0000-0000-000000000264",
+ },
+ "subject": {
+ "id": "00000000-0000-0000-0000-000000000261",
+ },
+ "timelineActivities": {
+ "id": "00000000-0000-0000-0000-000000000268",
+ },
+ "unsubscribeTopicId": {
+ "id": "00000000-0000-0000-0000-000000000266",
+ },
+ "updatedAt": {
+ "id": "00000000-0000-0000-0000-000000000255",
+ },
+ "updatedBy": {
"id": "00000000-0000-0000-0000-000000000258",
},
+ },
+ "id": "00000000-0000-0000-0000-000000000271",
+ "views": undefined,
+ },
+ "messageChannelMessageAssociation": {
+ "fields": {
+ "createdAt": {
+ "id": "00000000-0000-0000-0000-000000000297",
+ },
+ "createdBy": {
+ "id": "00000000-0000-0000-0000-000000000306",
+ },
+ "deletedAt": {
+ "id": "00000000-0000-0000-0000-000000000299",
+ },
+ "direction": {
+ "id": "00000000-0000-0000-0000-000000000305",
+ },
+ "id": {
+ "id": "00000000-0000-0000-0000-000000000296",
+ },
+ "message": {
+ "id": "00000000-0000-0000-0000-000000000301",
+ },
"messageChannelId": {
- "id": "00000000-0000-0000-0000-000000000257",
+ "id": "00000000-0000-0000-0000-000000000300",
},
"messageExternalId": {
- "id": "00000000-0000-0000-0000-000000000259",
+ "id": "00000000-0000-0000-0000-000000000302",
},
"messageFolders": {
- "id": "00000000-0000-0000-0000-000000000267",
+ "id": "00000000-0000-0000-0000-000000000310",
},
"messageThread": {
- "id": "00000000-0000-0000-0000-000000000260",
+ "id": "00000000-0000-0000-0000-000000000303",
},
"messageThreadExternalId": {
- "id": "00000000-0000-0000-0000-000000000261",
+ "id": "00000000-0000-0000-0000-000000000304",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000265",
+ "id": "00000000-0000-0000-0000-000000000308",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000266",
+ "id": "00000000-0000-0000-0000-000000000309",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000255",
+ "id": "00000000-0000-0000-0000-000000000298",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000264",
+ "id": "00000000-0000-0000-0000-000000000307",
},
},
- "id": "00000000-0000-0000-0000-000000000283",
+ "id": "00000000-0000-0000-0000-000000000326",
"views": {
"allMessageChannelMessageAssociations": {
- "id": "00000000-0000-0000-0000-000000000273",
+ "id": "00000000-0000-0000-0000-000000000316",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000272",
+ "id": "00000000-0000-0000-0000-000000000315",
},
"direction": {
- "id": "00000000-0000-0000-0000-000000000271",
+ "id": "00000000-0000-0000-0000-000000000314",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000269",
+ "id": "00000000-0000-0000-0000-000000000312",
},
"messageChannelId": {
- "id": "00000000-0000-0000-0000-000000000268",
+ "id": "00000000-0000-0000-0000-000000000311",
},
"messageExternalId": {
- "id": "00000000-0000-0000-0000-000000000270",
+ "id": "00000000-0000-0000-0000-000000000313",
},
},
"viewGroups": {},
},
"messageChannelMessageAssociationRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000282",
+ "id": "00000000-0000-0000-0000-000000000325",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000280",
+ "id": "00000000-0000-0000-0000-000000000323",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000281",
+ "id": "00000000-0000-0000-0000-000000000324",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000278",
+ "id": "00000000-0000-0000-0000-000000000321",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000279",
+ "id": "00000000-0000-0000-0000-000000000322",
},
"direction": {
- "id": "00000000-0000-0000-0000-000000000277",
+ "id": "00000000-0000-0000-0000-000000000320",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000275",
+ "id": "00000000-0000-0000-0000-000000000318",
},
"messageChannelId": {
- "id": "00000000-0000-0000-0000-000000000274",
+ "id": "00000000-0000-0000-0000-000000000317",
},
"messageExternalId": {
- "id": "00000000-0000-0000-0000-000000000276",
+ "id": "00000000-0000-0000-0000-000000000319",
},
},
"viewGroups": {},
@@ -1036,188 +1102,269 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"messageChannelMessageAssociationMessageFolder": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000285",
+ "id": "00000000-0000-0000-0000-000000000328",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000288",
+ "id": "00000000-0000-0000-0000-000000000331",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000287",
+ "id": "00000000-0000-0000-0000-000000000330",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000284",
+ "id": "00000000-0000-0000-0000-000000000327",
},
"messageChannelMessageAssociation": {
- "id": "00000000-0000-0000-0000-000000000292",
+ "id": "00000000-0000-0000-0000-000000000335",
},
"messageFolderId": {
- "id": "00000000-0000-0000-0000-000000000293",
+ "id": "00000000-0000-0000-0000-000000000336",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000290",
+ "id": "00000000-0000-0000-0000-000000000333",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000291",
+ "id": "00000000-0000-0000-0000-000000000334",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000286",
+ "id": "00000000-0000-0000-0000-000000000329",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000289",
+ "id": "00000000-0000-0000-0000-000000000332",
},
},
- "id": "00000000-0000-0000-0000-000000000305",
+ "id": "00000000-0000-0000-0000-000000000348",
"views": {
"allMessageChannelMessageAssociationMessageFolders": {
- "id": "00000000-0000-0000-0000-000000000297",
+ "id": "00000000-0000-0000-0000-000000000340",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000296",
+ "id": "00000000-0000-0000-0000-000000000339",
},
"messageChannelMessageAssociation": {
- "id": "00000000-0000-0000-0000-000000000294",
+ "id": "00000000-0000-0000-0000-000000000337",
},
"messageFolderId": {
- "id": "00000000-0000-0000-0000-000000000295",
+ "id": "00000000-0000-0000-0000-000000000338",
},
},
"viewGroups": {},
},
"messageChannelMessageAssociationMessageFolderRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000304",
+ "id": "00000000-0000-0000-0000-000000000347",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000302",
+ "id": "00000000-0000-0000-0000-000000000345",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000303",
+ "id": "00000000-0000-0000-0000-000000000346",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000300",
+ "id": "00000000-0000-0000-0000-000000000343",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000301",
+ "id": "00000000-0000-0000-0000-000000000344",
},
"messageChannelMessageAssociation": {
- "id": "00000000-0000-0000-0000-000000000298",
+ "id": "00000000-0000-0000-0000-000000000341",
},
"messageFolderId": {
- "id": "00000000-0000-0000-0000-000000000299",
+ "id": "00000000-0000-0000-0000-000000000342",
},
},
"viewGroups": {},
},
},
},
+ "messageList": {
+ "fields": {
+ "campaigns": {
+ "id": "00000000-0000-0000-0000-000000000282",
+ },
+ "createdAt": {
+ "id": "00000000-0000-0000-0000-000000000273",
+ },
+ "createdBy": {
+ "id": "00000000-0000-0000-0000-000000000276",
+ },
+ "deletedAt": {
+ "id": "00000000-0000-0000-0000-000000000275",
+ },
+ "id": {
+ "id": "00000000-0000-0000-0000-000000000272",
+ },
+ "members": {
+ "id": "00000000-0000-0000-0000-000000000281",
+ },
+ "name": {
+ "id": "00000000-0000-0000-0000-000000000280",
+ },
+ "position": {
+ "id": "00000000-0000-0000-0000-000000000278",
+ },
+ "searchVector": {
+ "id": "00000000-0000-0000-0000-000000000279",
+ },
+ "timelineActivities": {
+ "id": "00000000-0000-0000-0000-000000000283",
+ },
+ "updatedAt": {
+ "id": "00000000-0000-0000-0000-000000000274",
+ },
+ "updatedBy": {
+ "id": "00000000-0000-0000-0000-000000000277",
+ },
+ },
+ "id": "00000000-0000-0000-0000-000000000284",
+ "views": undefined,
+ },
+ "messageListMember": {
+ "fields": {
+ "createdAt": {
+ "id": "00000000-0000-0000-0000-000000000286",
+ },
+ "createdBy": {
+ "id": "00000000-0000-0000-0000-000000000289",
+ },
+ "deletedAt": {
+ "id": "00000000-0000-0000-0000-000000000288",
+ },
+ "id": {
+ "id": "00000000-0000-0000-0000-000000000285",
+ },
+ "list": {
+ "id": "00000000-0000-0000-0000-000000000294",
+ },
+ "person": {
+ "id": "00000000-0000-0000-0000-000000000293",
+ },
+ "position": {
+ "id": "00000000-0000-0000-0000-000000000291",
+ },
+ "searchVector": {
+ "id": "00000000-0000-0000-0000-000000000292",
+ },
+ "updatedAt": {
+ "id": "00000000-0000-0000-0000-000000000287",
+ },
+ "updatedBy": {
+ "id": "00000000-0000-0000-0000-000000000290",
+ },
+ },
+ "id": "00000000-0000-0000-0000-000000000295",
+ "views": undefined,
+ },
"messageParticipant": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000307",
+ "id": "00000000-0000-0000-0000-000000000350",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000316",
+ "id": "00000000-0000-0000-0000-000000000360",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000309",
+ "id": "00000000-0000-0000-0000-000000000352",
},
"displayName": {
- "id": "00000000-0000-0000-0000-000000000313",
+ "id": "00000000-0000-0000-0000-000000000356",
},
"handle": {
- "id": "00000000-0000-0000-0000-000000000312",
+ "id": "00000000-0000-0000-0000-000000000355",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000306",
+ "id": "00000000-0000-0000-0000-000000000349",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000310",
+ "id": "00000000-0000-0000-0000-000000000353",
+ },
+ "messageCampaign": {
+ "id": "00000000-0000-0000-0000-000000000359",
},
"person": {
- "id": "00000000-0000-0000-0000-000000000314",
+ "id": "00000000-0000-0000-0000-000000000357",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000318",
+ "id": "00000000-0000-0000-0000-000000000362",
},
"role": {
- "id": "00000000-0000-0000-0000-000000000311",
+ "id": "00000000-0000-0000-0000-000000000354",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000319",
+ "id": "00000000-0000-0000-0000-000000000363",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000308",
+ "id": "00000000-0000-0000-0000-000000000351",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000317",
+ "id": "00000000-0000-0000-0000-000000000361",
},
"workspaceMember": {
- "id": "00000000-0000-0000-0000-000000000315",
+ "id": "00000000-0000-0000-0000-000000000358",
},
},
- "id": "00000000-0000-0000-0000-000000000338",
+ "id": "00000000-0000-0000-0000-000000000382",
"views": {
"allMessageParticipants": {
- "id": "00000000-0000-0000-0000-000000000327",
+ "id": "00000000-0000-0000-0000-000000000371",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000326",
+ "id": "00000000-0000-0000-0000-000000000370",
},
"displayName": {
- "id": "00000000-0000-0000-0000-000000000323",
+ "id": "00000000-0000-0000-0000-000000000367",
},
"handle": {
- "id": "00000000-0000-0000-0000-000000000322",
+ "id": "00000000-0000-0000-0000-000000000366",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000320",
+ "id": "00000000-0000-0000-0000-000000000364",
},
"person": {
- "id": "00000000-0000-0000-0000-000000000324",
+ "id": "00000000-0000-0000-0000-000000000368",
},
"role": {
- "id": "00000000-0000-0000-0000-000000000321",
+ "id": "00000000-0000-0000-0000-000000000365",
},
"workspaceMember": {
- "id": "00000000-0000-0000-0000-000000000325",
+ "id": "00000000-0000-0000-0000-000000000369",
},
},
"viewGroups": {},
},
"messageParticipantRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000337",
+ "id": "00000000-0000-0000-0000-000000000381",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000335",
+ "id": "00000000-0000-0000-0000-000000000379",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000336",
+ "id": "00000000-0000-0000-0000-000000000380",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000333",
+ "id": "00000000-0000-0000-0000-000000000377",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000334",
+ "id": "00000000-0000-0000-0000-000000000378",
},
"displayName": {
- "id": "00000000-0000-0000-0000-000000000330",
+ "id": "00000000-0000-0000-0000-000000000374",
},
"message": {
- "id": "00000000-0000-0000-0000-000000000328",
+ "id": "00000000-0000-0000-0000-000000000372",
},
"person": {
- "id": "00000000-0000-0000-0000-000000000331",
+ "id": "00000000-0000-0000-0000-000000000375",
},
"role": {
- "id": "00000000-0000-0000-0000-000000000329",
+ "id": "00000000-0000-0000-0000-000000000373",
},
"workspaceMember": {
- "id": "00000000-0000-0000-0000-000000000332",
+ "id": "00000000-0000-0000-0000-000000000376",
},
},
"viewGroups": {},
@@ -1227,56 +1374,56 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"messageThread": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000340",
+ "id": "00000000-0000-0000-0000-000000000384",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000345",
+ "id": "00000000-0000-0000-0000-000000000389",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000342",
+ "id": "00000000-0000-0000-0000-000000000386",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000339",
+ "id": "00000000-0000-0000-0000-000000000383",
},
"messageChannelMessageAssociations": {
- "id": "00000000-0000-0000-0000-000000000344",
+ "id": "00000000-0000-0000-0000-000000000388",
},
"messages": {
- "id": "00000000-0000-0000-0000-000000000343",
+ "id": "00000000-0000-0000-0000-000000000387",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000347",
+ "id": "00000000-0000-0000-0000-000000000391",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000348",
+ "id": "00000000-0000-0000-0000-000000000392",
},
"subject": {
- "id": "00000000-0000-0000-0000-000000000349",
+ "id": "00000000-0000-0000-0000-000000000393",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000341",
+ "id": "00000000-0000-0000-0000-000000000385",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000346",
+ "id": "00000000-0000-0000-0000-000000000390",
},
},
- "id": "00000000-0000-0000-0000-000000000355",
+ "id": "00000000-0000-0000-0000-000000000399",
"views": {
"allMessageThreads": {
- "id": "00000000-0000-0000-0000-000000000354",
+ "id": "00000000-0000-0000-0000-000000000398",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000353",
+ "id": "00000000-0000-0000-0000-000000000397",
},
"messages": {
- "id": "00000000-0000-0000-0000-000000000351",
+ "id": "00000000-0000-0000-0000-000000000395",
},
"subject": {
- "id": "00000000-0000-0000-0000-000000000350",
+ "id": "00000000-0000-0000-0000-000000000394",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000352",
+ "id": "00000000-0000-0000-0000-000000000396",
},
},
"viewGroups": {},
@@ -1286,103 +1433,103 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"note": {
"fields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000390",
+ "id": "00000000-0000-0000-0000-000000000436",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000386",
+ "id": "00000000-0000-0000-0000-000000000432",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000381",
+ "id": "00000000-0000-0000-0000-000000000427",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000387",
+ "id": "00000000-0000-0000-0000-000000000433",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000383",
+ "id": "00000000-0000-0000-0000-000000000429",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000380",
+ "id": "00000000-0000-0000-0000-000000000426",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000389",
+ "id": "00000000-0000-0000-0000-000000000435",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000384",
+ "id": "00000000-0000-0000-0000-000000000430",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000392",
+ "id": "00000000-0000-0000-0000-000000000438",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000391",
+ "id": "00000000-0000-0000-0000-000000000437",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000385",
+ "id": "00000000-0000-0000-0000-000000000431",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000382",
+ "id": "00000000-0000-0000-0000-000000000428",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000388",
+ "id": "00000000-0000-0000-0000-000000000434",
},
},
- "id": "00000000-0000-0000-0000-000000000410",
+ "id": "00000000-0000-0000-0000-000000000456",
"views": {
"allNotes": {
- "id": "00000000-0000-0000-0000-000000000398",
+ "id": "00000000-0000-0000-0000-000000000444",
"viewFieldGroups": {},
"viewFields": {
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000395",
+ "id": "00000000-0000-0000-0000-000000000441",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000397",
+ "id": "00000000-0000-0000-0000-000000000443",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000396",
+ "id": "00000000-0000-0000-0000-000000000442",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000394",
+ "id": "00000000-0000-0000-0000-000000000440",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000393",
+ "id": "00000000-0000-0000-0000-000000000439",
},
},
"viewGroups": {},
},
"noteRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000409",
+ "id": "00000000-0000-0000-0000-000000000455",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000407",
+ "id": "00000000-0000-0000-0000-000000000453",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000408",
+ "id": "00000000-0000-0000-0000-000000000454",
},
},
"viewFields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000405",
+ "id": "00000000-0000-0000-0000-000000000451",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000402",
+ "id": "00000000-0000-0000-0000-000000000448",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000399",
+ "id": "00000000-0000-0000-0000-000000000445",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000400",
+ "id": "00000000-0000-0000-0000-000000000446",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000401",
+ "id": "00000000-0000-0000-0000-000000000447",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000406",
+ "id": "00000000-0000-0000-0000-000000000452",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000403",
+ "id": "00000000-0000-0000-0000-000000000449",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000404",
+ "id": "00000000-0000-0000-0000-000000000450",
},
},
"viewGroups": {},
@@ -1392,62 +1539,62 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"noteTarget": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000412",
+ "id": "00000000-0000-0000-0000-000000000458",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000419",
+ "id": "00000000-0000-0000-0000-000000000465",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000414",
+ "id": "00000000-0000-0000-0000-000000000460",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000411",
+ "id": "00000000-0000-0000-0000-000000000457",
},
"note": {
- "id": "00000000-0000-0000-0000-000000000415",
+ "id": "00000000-0000-0000-0000-000000000461",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000421",
+ "id": "00000000-0000-0000-0000-000000000467",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000422",
+ "id": "00000000-0000-0000-0000-000000000468",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000417",
+ "id": "00000000-0000-0000-0000-000000000463",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000418",
+ "id": "00000000-0000-0000-0000-000000000464",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000416",
+ "id": "00000000-0000-0000-0000-000000000462",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000413",
+ "id": "00000000-0000-0000-0000-000000000459",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000420",
+ "id": "00000000-0000-0000-0000-000000000466",
},
},
- "id": "00000000-0000-0000-0000-000000000429",
+ "id": "00000000-0000-0000-0000-000000000475",
"views": {
"allNoteTargets": {
- "id": "00000000-0000-0000-0000-000000000428",
+ "id": "00000000-0000-0000-0000-000000000474",
"viewFieldGroups": {},
"viewFields": {
"id": {
- "id": "00000000-0000-0000-0000-000000000423",
+ "id": "00000000-0000-0000-0000-000000000469",
},
"note": {
- "id": "00000000-0000-0000-0000-000000000424",
+ "id": "00000000-0000-0000-0000-000000000470",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000426",
+ "id": "00000000-0000-0000-0000-000000000472",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000427",
+ "id": "00000000-0000-0000-0000-000000000473",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000425",
+ "id": "00000000-0000-0000-0000-000000000471",
},
},
"viewGroups": {},
@@ -1457,186 +1604,186 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"opportunity": {
"fields": {
"amount": {
- "id": "00000000-0000-0000-0000-000000000435",
+ "id": "00000000-0000-0000-0000-000000000481",
},
"attachments": {
- "id": "00000000-0000-0000-0000-000000000446",
+ "id": "00000000-0000-0000-0000-000000000492",
},
"closeDate": {
- "id": "00000000-0000-0000-0000-000000000436",
+ "id": "00000000-0000-0000-0000-000000000482",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000442",
+ "id": "00000000-0000-0000-0000-000000000488",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000431",
+ "id": "00000000-0000-0000-0000-000000000477",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000439",
+ "id": "00000000-0000-0000-0000-000000000485",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000433",
+ "id": "00000000-0000-0000-0000-000000000479",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000430",
+ "id": "00000000-0000-0000-0000-000000000476",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000434",
+ "id": "00000000-0000-0000-0000-000000000480",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000445",
+ "id": "00000000-0000-0000-0000-000000000491",
},
"owner": {
- "id": "00000000-0000-0000-0000-000000000443",
+ "id": "00000000-0000-0000-0000-000000000489",
},
"pointOfContact": {
- "id": "00000000-0000-0000-0000-000000000441",
+ "id": "00000000-0000-0000-0000-000000000487",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000438",
+ "id": "00000000-0000-0000-0000-000000000484",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000448",
+ "id": "00000000-0000-0000-0000-000000000494",
},
"stage": {
- "id": "00000000-0000-0000-0000-000000000437",
+ "id": "00000000-0000-0000-0000-000000000483",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000444",
+ "id": "00000000-0000-0000-0000-000000000490",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000447",
+ "id": "00000000-0000-0000-0000-000000000493",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000432",
+ "id": "00000000-0000-0000-0000-000000000478",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000440",
+ "id": "00000000-0000-0000-0000-000000000486",
},
},
- "id": "00000000-0000-0000-0000-000000000486",
+ "id": "00000000-0000-0000-0000-000000000532",
"views": {
"allOpportunities": {
- "id": "00000000-0000-0000-0000-000000000455",
+ "id": "00000000-0000-0000-0000-000000000501",
"viewFieldGroups": {},
"viewFields": {
"amount": {
- "id": "00000000-0000-0000-0000-000000000450",
+ "id": "00000000-0000-0000-0000-000000000496",
},
"closeDate": {
- "id": "00000000-0000-0000-0000-000000000452",
+ "id": "00000000-0000-0000-0000-000000000498",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000453",
+ "id": "00000000-0000-0000-0000-000000000499",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000451",
+ "id": "00000000-0000-0000-0000-000000000497",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000449",
+ "id": "00000000-0000-0000-0000-000000000495",
},
"pointOfContact": {
- "id": "00000000-0000-0000-0000-000000000454",
+ "id": "00000000-0000-0000-0000-000000000500",
},
},
"viewGroups": {},
},
"byStage": {
- "id": "00000000-0000-0000-0000-000000000467",
+ "id": "00000000-0000-0000-0000-000000000513",
"viewFieldGroups": {},
"viewFields": {
"amount": {
- "id": "00000000-0000-0000-0000-000000000457",
+ "id": "00000000-0000-0000-0000-000000000503",
},
"closeDate": {
- "id": "00000000-0000-0000-0000-000000000459",
+ "id": "00000000-0000-0000-0000-000000000505",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000460",
+ "id": "00000000-0000-0000-0000-000000000506",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000458",
+ "id": "00000000-0000-0000-0000-000000000504",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000456",
+ "id": "00000000-0000-0000-0000-000000000502",
},
"pointOfContact": {
- "id": "00000000-0000-0000-0000-000000000461",
+ "id": "00000000-0000-0000-0000-000000000507",
},
},
"viewGroups": {
"customer": {
- "id": "00000000-0000-0000-0000-000000000466",
+ "id": "00000000-0000-0000-0000-000000000512",
},
"meeting": {
- "id": "00000000-0000-0000-0000-000000000464",
+ "id": "00000000-0000-0000-0000-000000000510",
},
"new": {
- "id": "00000000-0000-0000-0000-000000000462",
+ "id": "00000000-0000-0000-0000-000000000508",
},
"proposal": {
- "id": "00000000-0000-0000-0000-000000000465",
+ "id": "00000000-0000-0000-0000-000000000511",
},
"screening": {
- "id": "00000000-0000-0000-0000-000000000463",
+ "id": "00000000-0000-0000-0000-000000000509",
},
},
},
"opportunityRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000485",
+ "id": "00000000-0000-0000-0000-000000000531",
"viewFieldGroups": {
"deal": {
- "id": "00000000-0000-0000-0000-000000000482",
+ "id": "00000000-0000-0000-0000-000000000528",
},
"relations": {
- "id": "00000000-0000-0000-0000-000000000483",
+ "id": "00000000-0000-0000-0000-000000000529",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000484",
+ "id": "00000000-0000-0000-0000-000000000530",
},
},
"viewFields": {
"amount": {
- "id": "00000000-0000-0000-0000-000000000468",
+ "id": "00000000-0000-0000-0000-000000000514",
},
"attachments": {
- "id": "00000000-0000-0000-0000-000000000480",
+ "id": "00000000-0000-0000-0000-000000000526",
},
"closeDate": {
- "id": "00000000-0000-0000-0000-000000000469",
+ "id": "00000000-0000-0000-0000-000000000515",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000471",
+ "id": "00000000-0000-0000-0000-000000000517",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000474",
+ "id": "00000000-0000-0000-0000-000000000520",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000475",
+ "id": "00000000-0000-0000-0000-000000000521",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000479",
+ "id": "00000000-0000-0000-0000-000000000525",
},
"owner": {
- "id": "00000000-0000-0000-0000-000000000473",
+ "id": "00000000-0000-0000-0000-000000000519",
},
"pointOfContact": {
- "id": "00000000-0000-0000-0000-000000000472",
+ "id": "00000000-0000-0000-0000-000000000518",
},
"stage": {
- "id": "00000000-0000-0000-0000-000000000470",
+ "id": "00000000-0000-0000-0000-000000000516",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000478",
+ "id": "00000000-0000-0000-0000-000000000524",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000481",
+ "id": "00000000-0000-0000-0000-000000000527",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000476",
+ "id": "00000000-0000-0000-0000-000000000522",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000477",
+ "id": "00000000-0000-0000-0000-000000000523",
},
},
"viewGroups": {},
@@ -1646,178 +1793,181 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"person": {
"fields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000505",
+ "id": "00000000-0000-0000-0000-000000000551",
},
"avatarFile": {
- "id": "00000000-0000-0000-0000-000000000497",
+ "id": "00000000-0000-0000-0000-000000000543",
},
"avatarUrl": {
- "id": "00000000-0000-0000-0000-000000000496",
+ "id": "00000000-0000-0000-0000-000000000542",
},
"calendarEventParticipants": {
- "id": "00000000-0000-0000-0000-000000000507",
+ "id": "00000000-0000-0000-0000-000000000553",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000501",
+ "id": "00000000-0000-0000-0000-000000000547",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000488",
+ "id": "00000000-0000-0000-0000-000000000534",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000499",
+ "id": "00000000-0000-0000-0000-000000000545",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000490",
+ "id": "00000000-0000-0000-0000-000000000536",
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000492",
+ "id": "00000000-0000-0000-0000-000000000538",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000487",
+ "id": "00000000-0000-0000-0000-000000000533",
},
"jobTitle": {
- "id": "00000000-0000-0000-0000-000000000494",
+ "id": "00000000-0000-0000-0000-000000000540",
},
"linkedinLink": {
- "id": "00000000-0000-0000-0000-000000000493",
+ "id": "00000000-0000-0000-0000-000000000539",
+ },
+ "listMemberships": {
+ "id": "00000000-0000-0000-0000-000000000555",
},
"messageParticipants": {
- "id": "00000000-0000-0000-0000-000000000506",
+ "id": "00000000-0000-0000-0000-000000000552",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000491",
+ "id": "00000000-0000-0000-0000-000000000537",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000504",
+ "id": "00000000-0000-0000-0000-000000000550",
},
"phones": {
- "id": "00000000-0000-0000-0000-000000000495",
+ "id": "00000000-0000-0000-0000-000000000541",
},
"pointOfContactForOpportunities": {
- "id": "00000000-0000-0000-0000-000000000502",
+ "id": "00000000-0000-0000-0000-000000000548",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000498",
+ "id": "00000000-0000-0000-0000-000000000544",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000509",
+ "id": "00000000-0000-0000-0000-000000000556",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000503",
+ "id": "00000000-0000-0000-0000-000000000549",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000508",
+ "id": "00000000-0000-0000-0000-000000000554",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000489",
+ "id": "00000000-0000-0000-0000-000000000535",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000500",
+ "id": "00000000-0000-0000-0000-000000000546",
},
},
- "id": "00000000-0000-0000-0000-000000000542",
+ "id": "00000000-0000-0000-0000-000000000589",
"views": {
"allPeople": {
- "id": "00000000-0000-0000-0000-000000000518",
+ "id": "00000000-0000-0000-0000-000000000565",
"viewFieldGroups": {},
"viewFields": {
"company": {
- "id": "00000000-0000-0000-0000-000000000513",
+ "id": "00000000-0000-0000-0000-000000000560",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000515",
+ "id": "00000000-0000-0000-0000-000000000562",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000512",
+ "id": "00000000-0000-0000-0000-000000000559",
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000511",
+ "id": "00000000-0000-0000-0000-000000000558",
},
"jobTitle": {
- "id": "00000000-0000-0000-0000-000000000516",
+ "id": "00000000-0000-0000-0000-000000000563",
},
"linkedinLink": {
- "id": "00000000-0000-0000-0000-000000000517",
+ "id": "00000000-0000-0000-0000-000000000564",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000510",
+ "id": "00000000-0000-0000-0000-000000000557",
},
"phones": {
- "id": "00000000-0000-0000-0000-000000000514",
+ "id": "00000000-0000-0000-0000-000000000561",
},
},
"viewGroups": {},
},
"personRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000541",
+ "id": "00000000-0000-0000-0000-000000000588",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000537",
+ "id": "00000000-0000-0000-0000-000000000584",
},
"social": {
- "id": "00000000-0000-0000-0000-000000000539",
+ "id": "00000000-0000-0000-0000-000000000586",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000540",
+ "id": "00000000-0000-0000-0000-000000000587",
},
"work": {
- "id": "00000000-0000-0000-0000-000000000538",
+ "id": "00000000-0000-0000-0000-000000000585",
},
},
"viewFields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000533",
+ "id": "00000000-0000-0000-0000-000000000580",
},
"avatarFile": {
- "id": "00000000-0000-0000-0000-000000000529",
+ "id": "00000000-0000-0000-0000-000000000576",
},
"avatarUrl": {
- "id": "00000000-0000-0000-0000-000000000524",
+ "id": "00000000-0000-0000-0000-000000000571",
},
"calendarEventParticipants": {
- "id": "00000000-0000-0000-0000-000000000535",
+ "id": "00000000-0000-0000-0000-000000000582",
},
"company": {
- "id": "00000000-0000-0000-0000-000000000521",
+ "id": "00000000-0000-0000-0000-000000000568",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000525",
+ "id": "00000000-0000-0000-0000-000000000572",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000526",
+ "id": "00000000-0000-0000-0000-000000000573",
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000519",
+ "id": "00000000-0000-0000-0000-000000000566",
},
"jobTitle": {
- "id": "00000000-0000-0000-0000-000000000522",
+ "id": "00000000-0000-0000-0000-000000000569",
},
"linkedinLink": {
- "id": "00000000-0000-0000-0000-000000000523",
+ "id": "00000000-0000-0000-0000-000000000570",
},
"messageParticipants": {
- "id": "00000000-0000-0000-0000-000000000534",
+ "id": "00000000-0000-0000-0000-000000000581",
},
"noteTargets": {
- "id": "00000000-0000-0000-0000-000000000532",
+ "id": "00000000-0000-0000-0000-000000000579",
},
"phones": {
- "id": "00000000-0000-0000-0000-000000000520",
+ "id": "00000000-0000-0000-0000-000000000567",
},
"pointOfContactForOpportunities": {
- "id": "00000000-0000-0000-0000-000000000530",
+ "id": "00000000-0000-0000-0000-000000000577",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000531",
+ "id": "00000000-0000-0000-0000-000000000578",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000536",
+ "id": "00000000-0000-0000-0000-000000000583",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000527",
+ "id": "00000000-0000-0000-0000-000000000574",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000528",
+ "id": "00000000-0000-0000-0000-000000000575",
},
},
"viewGroups": {},
@@ -1827,203 +1977,203 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"task": {
"fields": {
"assignee": {
- "id": "00000000-0000-0000-0000-000000000556",
+ "id": "00000000-0000-0000-0000-000000000603",
},
"attachments": {
- "id": "00000000-0000-0000-0000-000000000555",
+ "id": "00000000-0000-0000-0000-000000000602",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000549",
+ "id": "00000000-0000-0000-0000-000000000596",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000544",
+ "id": "00000000-0000-0000-0000-000000000591",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000552",
+ "id": "00000000-0000-0000-0000-000000000599",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000546",
+ "id": "00000000-0000-0000-0000-000000000593",
},
"dueAt": {
- "id": "00000000-0000-0000-0000-000000000550",
+ "id": "00000000-0000-0000-0000-000000000597",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000543",
+ "id": "00000000-0000-0000-0000-000000000590",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000547",
+ "id": "00000000-0000-0000-0000-000000000594",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000558",
+ "id": "00000000-0000-0000-0000-000000000605",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000551",
+ "id": "00000000-0000-0000-0000-000000000598",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000554",
+ "id": "00000000-0000-0000-0000-000000000601",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000557",
+ "id": "00000000-0000-0000-0000-000000000604",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000548",
+ "id": "00000000-0000-0000-0000-000000000595",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000545",
+ "id": "00000000-0000-0000-0000-000000000592",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000553",
+ "id": "00000000-0000-0000-0000-000000000600",
},
},
- "id": "00000000-0000-0000-0000-000000000603",
+ "id": "00000000-0000-0000-0000-000000000650",
"views": {
"allTasks": {
- "id": "00000000-0000-0000-0000-000000000567",
+ "id": "00000000-0000-0000-0000-000000000614",
"viewFieldGroups": {},
"viewFields": {
"assignee": {
- "id": "00000000-0000-0000-0000-000000000564",
+ "id": "00000000-0000-0000-0000-000000000611",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000565",
+ "id": "00000000-0000-0000-0000-000000000612",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000566",
+ "id": "00000000-0000-0000-0000-000000000613",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000562",
+ "id": "00000000-0000-0000-0000-000000000609",
},
"dueAt": {
- "id": "00000000-0000-0000-0000-000000000563",
+ "id": "00000000-0000-0000-0000-000000000610",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000560",
+ "id": "00000000-0000-0000-0000-000000000607",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000561",
+ "id": "00000000-0000-0000-0000-000000000608",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000559",
+ "id": "00000000-0000-0000-0000-000000000606",
},
},
"viewGroups": {},
},
"assignedToMe": {
- "id": "00000000-0000-0000-0000-000000000579",
+ "id": "00000000-0000-0000-0000-000000000626",
"viewFieldGroups": {},
"viewFields": {
"assignee": {
- "id": "00000000-0000-0000-0000-000000000572",
+ "id": "00000000-0000-0000-0000-000000000619",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000573",
+ "id": "00000000-0000-0000-0000-000000000620",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000574",
+ "id": "00000000-0000-0000-0000-000000000621",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000570",
+ "id": "00000000-0000-0000-0000-000000000617",
},
"dueAt": {
- "id": "00000000-0000-0000-0000-000000000571",
+ "id": "00000000-0000-0000-0000-000000000618",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000569",
+ "id": "00000000-0000-0000-0000-000000000616",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000568",
+ "id": "00000000-0000-0000-0000-000000000615",
},
},
"viewGroups": {
"done": {
- "id": "00000000-0000-0000-0000-000000000577",
+ "id": "00000000-0000-0000-0000-000000000624",
},
"empty": {
- "id": "00000000-0000-0000-0000-000000000578",
+ "id": "00000000-0000-0000-0000-000000000625",
},
"inProgress": {
- "id": "00000000-0000-0000-0000-000000000576",
+ "id": "00000000-0000-0000-0000-000000000623",
},
"todo": {
- "id": "00000000-0000-0000-0000-000000000575",
+ "id": "00000000-0000-0000-0000-000000000622",
},
},
},
"byStatus": {
- "id": "00000000-0000-0000-0000-000000000588",
+ "id": "00000000-0000-0000-0000-000000000635",
"viewFieldGroups": {},
"viewFields": {
"assignee": {
- "id": "00000000-0000-0000-0000-000000000583",
+ "id": "00000000-0000-0000-0000-000000000630",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000584",
+ "id": "00000000-0000-0000-0000-000000000631",
},
"dueAt": {
- "id": "00000000-0000-0000-0000-000000000582",
+ "id": "00000000-0000-0000-0000-000000000629",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000581",
+ "id": "00000000-0000-0000-0000-000000000628",
},
"title": {
- "id": "00000000-0000-0000-0000-000000000580",
+ "id": "00000000-0000-0000-0000-000000000627",
},
},
"viewGroups": {
"done": {
- "id": "00000000-0000-0000-0000-000000000587",
+ "id": "00000000-0000-0000-0000-000000000634",
},
"inProgress": {
- "id": "00000000-0000-0000-0000-000000000586",
+ "id": "00000000-0000-0000-0000-000000000633",
},
"todo": {
- "id": "00000000-0000-0000-0000-000000000585",
+ "id": "00000000-0000-0000-0000-000000000632",
},
},
},
"taskRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000602",
+ "id": "00000000-0000-0000-0000-000000000649",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000600",
+ "id": "00000000-0000-0000-0000-000000000647",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000601",
+ "id": "00000000-0000-0000-0000-000000000648",
},
},
"viewFields": {
"assignee": {
- "id": "00000000-0000-0000-0000-000000000591",
+ "id": "00000000-0000-0000-0000-000000000638",
},
"attachments": {
- "id": "00000000-0000-0000-0000-000000000598",
+ "id": "00000000-0000-0000-0000-000000000645",
},
"bodyV2": {
- "id": "00000000-0000-0000-0000-000000000595",
+ "id": "00000000-0000-0000-0000-000000000642",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000592",
+ "id": "00000000-0000-0000-0000-000000000639",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000593",
+ "id": "00000000-0000-0000-0000-000000000640",
},
"dueAt": {
- "id": "00000000-0000-0000-0000-000000000589",
+ "id": "00000000-0000-0000-0000-000000000636",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000590",
+ "id": "00000000-0000-0000-0000-000000000637",
},
"taskTargets": {
- "id": "00000000-0000-0000-0000-000000000594",
+ "id": "00000000-0000-0000-0000-000000000641",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000599",
+ "id": "00000000-0000-0000-0000-000000000646",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000596",
+ "id": "00000000-0000-0000-0000-000000000643",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000597",
+ "id": "00000000-0000-0000-0000-000000000644",
},
},
"viewGroups": {},
@@ -2033,62 +2183,62 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"taskTarget": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000605",
+ "id": "00000000-0000-0000-0000-000000000652",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000612",
+ "id": "00000000-0000-0000-0000-000000000659",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000607",
+ "id": "00000000-0000-0000-0000-000000000654",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000604",
+ "id": "00000000-0000-0000-0000-000000000651",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000614",
+ "id": "00000000-0000-0000-0000-000000000661",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000615",
+ "id": "00000000-0000-0000-0000-000000000662",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000610",
+ "id": "00000000-0000-0000-0000-000000000657",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000611",
+ "id": "00000000-0000-0000-0000-000000000658",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000609",
+ "id": "00000000-0000-0000-0000-000000000656",
},
"task": {
- "id": "00000000-0000-0000-0000-000000000608",
+ "id": "00000000-0000-0000-0000-000000000655",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000606",
+ "id": "00000000-0000-0000-0000-000000000653",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000613",
+ "id": "00000000-0000-0000-0000-000000000660",
},
},
- "id": "00000000-0000-0000-0000-000000000622",
+ "id": "00000000-0000-0000-0000-000000000669",
"views": {
"allTaskTargets": {
- "id": "00000000-0000-0000-0000-000000000621",
+ "id": "00000000-0000-0000-0000-000000000668",
"viewFieldGroups": {},
"viewFields": {
"id": {
- "id": "00000000-0000-0000-0000-000000000616",
+ "id": "00000000-0000-0000-0000-000000000663",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000619",
+ "id": "00000000-0000-0000-0000-000000000666",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000620",
+ "id": "00000000-0000-0000-0000-000000000667",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000618",
+ "id": "00000000-0000-0000-0000-000000000665",
},
"task": {
- "id": "00000000-0000-0000-0000-000000000617",
+ "id": "00000000-0000-0000-0000-000000000664",
},
},
"viewGroups": {},
@@ -2098,125 +2248,131 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"timelineActivity": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000624",
+ "id": "00000000-0000-0000-0000-000000000671",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000643",
+ "id": "00000000-0000-0000-0000-000000000692",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000626",
+ "id": "00000000-0000-0000-0000-000000000673",
},
"happensAt": {
- "id": "00000000-0000-0000-0000-000000000627",
+ "id": "00000000-0000-0000-0000-000000000674",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000623",
+ "id": "00000000-0000-0000-0000-000000000670",
},
"linkedObjectMetadataId": {
- "id": "00000000-0000-0000-0000-000000000642",
+ "id": "00000000-0000-0000-0000-000000000691",
},
"linkedRecordCachedName": {
- "id": "00000000-0000-0000-0000-000000000640",
+ "id": "00000000-0000-0000-0000-000000000689",
},
"linkedRecordId": {
- "id": "00000000-0000-0000-0000-000000000641",
+ "id": "00000000-0000-0000-0000-000000000690",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000628",
+ "id": "00000000-0000-0000-0000-000000000675",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000645",
+ "id": "00000000-0000-0000-0000-000000000694",
},
"properties": {
- "id": "00000000-0000-0000-0000-000000000629",
+ "id": "00000000-0000-0000-0000-000000000676",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000646",
+ "id": "00000000-0000-0000-0000-000000000695",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000632",
+ "id": "00000000-0000-0000-0000-000000000679",
},
"targetDashboard": {
- "id": "00000000-0000-0000-0000-000000000639",
+ "id": "00000000-0000-0000-0000-000000000686",
+ },
+ "targetMessageCampaign": {
+ "id": "00000000-0000-0000-0000-000000000688",
+ },
+ "targetMessageList": {
+ "id": "00000000-0000-0000-0000-000000000687",
},
"targetNote": {
- "id": "00000000-0000-0000-0000-000000000635",
+ "id": "00000000-0000-0000-0000-000000000682",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000633",
+ "id": "00000000-0000-0000-0000-000000000680",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000631",
+ "id": "00000000-0000-0000-0000-000000000678",
},
"targetTask": {
- "id": "00000000-0000-0000-0000-000000000634",
+ "id": "00000000-0000-0000-0000-000000000681",
},
"targetWorkflow": {
- "id": "00000000-0000-0000-0000-000000000636",
+ "id": "00000000-0000-0000-0000-000000000683",
},
"targetWorkflowRun": {
- "id": "00000000-0000-0000-0000-000000000638",
+ "id": "00000000-0000-0000-0000-000000000685",
},
"targetWorkflowVersion": {
- "id": "00000000-0000-0000-0000-000000000637",
+ "id": "00000000-0000-0000-0000-000000000684",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000625",
+ "id": "00000000-0000-0000-0000-000000000672",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000644",
+ "id": "00000000-0000-0000-0000-000000000693",
},
"workspaceMember": {
- "id": "00000000-0000-0000-0000-000000000630",
+ "id": "00000000-0000-0000-0000-000000000677",
},
},
- "id": "00000000-0000-0000-0000-000000000662",
+ "id": "00000000-0000-0000-0000-000000000711",
"views": {
"allTimelineActivities": {
- "id": "00000000-0000-0000-0000-000000000661",
+ "id": "00000000-0000-0000-0000-000000000710",
"viewFieldGroups": {},
"viewFields": {
"happensAt": {
- "id": "00000000-0000-0000-0000-000000000648",
+ "id": "00000000-0000-0000-0000-000000000697",
},
"linkedRecordCachedName": {
- "id": "00000000-0000-0000-0000-000000000651",
+ "id": "00000000-0000-0000-0000-000000000700",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000647",
+ "id": "00000000-0000-0000-0000-000000000696",
},
"properties": {
- "id": "00000000-0000-0000-0000-000000000649",
+ "id": "00000000-0000-0000-0000-000000000698",
},
"targetCompany": {
- "id": "00000000-0000-0000-0000-000000000653",
+ "id": "00000000-0000-0000-0000-000000000702",
},
"targetDashboard": {
- "id": "00000000-0000-0000-0000-000000000660",
+ "id": "00000000-0000-0000-0000-000000000709",
},
"targetNote": {
- "id": "00000000-0000-0000-0000-000000000656",
+ "id": "00000000-0000-0000-0000-000000000705",
},
"targetOpportunity": {
- "id": "00000000-0000-0000-0000-000000000654",
+ "id": "00000000-0000-0000-0000-000000000703",
},
"targetPerson": {
- "id": "00000000-0000-0000-0000-000000000652",
+ "id": "00000000-0000-0000-0000-000000000701",
},
"targetTask": {
- "id": "00000000-0000-0000-0000-000000000655",
+ "id": "00000000-0000-0000-0000-000000000704",
},
"targetWorkflow": {
- "id": "00000000-0000-0000-0000-000000000657",
+ "id": "00000000-0000-0000-0000-000000000706",
},
"targetWorkflowRun": {
- "id": "00000000-0000-0000-0000-000000000659",
+ "id": "00000000-0000-0000-0000-000000000708",
},
"targetWorkflowVersion": {
- "id": "00000000-0000-0000-0000-000000000658",
+ "id": "00000000-0000-0000-0000-000000000707",
},
"workspaceMember": {
- "id": "00000000-0000-0000-0000-000000000650",
+ "id": "00000000-0000-0000-0000-000000000699",
},
},
"viewGroups": {},
@@ -2226,77 +2382,77 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"workflow": {
"fields": {
"attachments": {
- "id": "00000000-0000-0000-0000-000000000675",
+ "id": "00000000-0000-0000-0000-000000000724",
},
"automatedTriggers": {
- "id": "00000000-0000-0000-0000-000000000673",
+ "id": "00000000-0000-0000-0000-000000000722",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000664",
+ "id": "00000000-0000-0000-0000-000000000713",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000676",
+ "id": "00000000-0000-0000-0000-000000000725",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000666",
+ "id": "00000000-0000-0000-0000-000000000715",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000663",
+ "id": "00000000-0000-0000-0000-000000000712",
},
"lastPublishedVersionId": {
- "id": "00000000-0000-0000-0000-000000000668",
+ "id": "00000000-0000-0000-0000-000000000717",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000667",
+ "id": "00000000-0000-0000-0000-000000000716",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000670",
+ "id": "00000000-0000-0000-0000-000000000719",
},
"runs": {
- "id": "00000000-0000-0000-0000-000000000672",
+ "id": "00000000-0000-0000-0000-000000000721",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000678",
+ "id": "00000000-0000-0000-0000-000000000727",
},
"statuses": {
- "id": "00000000-0000-0000-0000-000000000669",
+ "id": "00000000-0000-0000-0000-000000000718",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000674",
+ "id": "00000000-0000-0000-0000-000000000723",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000665",
+ "id": "00000000-0000-0000-0000-000000000714",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000677",
+ "id": "00000000-0000-0000-0000-000000000726",
},
"versions": {
- "id": "00000000-0000-0000-0000-000000000671",
+ "id": "00000000-0000-0000-0000-000000000720",
},
},
- "id": "00000000-0000-0000-0000-000000000686",
+ "id": "00000000-0000-0000-0000-000000000735",
"views": {
"allWorkflows": {
- "id": "00000000-0000-0000-0000-000000000685",
+ "id": "00000000-0000-0000-0000-000000000734",
"viewFieldGroups": {},
"viewFields": {
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000682",
+ "id": "00000000-0000-0000-0000-000000000731",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000679",
+ "id": "00000000-0000-0000-0000-000000000728",
},
"runs": {
- "id": "00000000-0000-0000-0000-000000000684",
+ "id": "00000000-0000-0000-0000-000000000733",
},
"statuses": {
- "id": "00000000-0000-0000-0000-000000000680",
+ "id": "00000000-0000-0000-0000-000000000729",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000681",
+ "id": "00000000-0000-0000-0000-000000000730",
},
"versions": {
- "id": "00000000-0000-0000-0000-000000000683",
+ "id": "00000000-0000-0000-0000-000000000732",
},
},
"viewGroups": {},
@@ -2306,79 +2462,79 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"workflowAutomatedTrigger": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000688",
+ "id": "00000000-0000-0000-0000-000000000737",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000694",
+ "id": "00000000-0000-0000-0000-000000000743",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000690",
+ "id": "00000000-0000-0000-0000-000000000739",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000687",
+ "id": "00000000-0000-0000-0000-000000000736",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000696",
+ "id": "00000000-0000-0000-0000-000000000745",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000697",
+ "id": "00000000-0000-0000-0000-000000000746",
},
"settings": {
- "id": "00000000-0000-0000-0000-000000000692",
+ "id": "00000000-0000-0000-0000-000000000741",
},
"type": {
- "id": "00000000-0000-0000-0000-000000000691",
+ "id": "00000000-0000-0000-0000-000000000740",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000689",
+ "id": "00000000-0000-0000-0000-000000000738",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000695",
+ "id": "00000000-0000-0000-0000-000000000744",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000693",
+ "id": "00000000-0000-0000-0000-000000000742",
},
},
- "id": "00000000-0000-0000-0000-000000000709",
+ "id": "00000000-0000-0000-0000-000000000758",
"views": {
"allWorkflowAutomatedTriggers": {
- "id": "00000000-0000-0000-0000-000000000701",
+ "id": "00000000-0000-0000-0000-000000000750",
"viewFieldGroups": {},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000700",
+ "id": "00000000-0000-0000-0000-000000000749",
},
"type": {
- "id": "00000000-0000-0000-0000-000000000698",
+ "id": "00000000-0000-0000-0000-000000000747",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000699",
+ "id": "00000000-0000-0000-0000-000000000748",
},
},
"viewGroups": {},
},
"workflowAutomatedTriggerRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000708",
+ "id": "00000000-0000-0000-0000-000000000757",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000706",
+ "id": "00000000-0000-0000-0000-000000000755",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000707",
+ "id": "00000000-0000-0000-0000-000000000756",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000704",
+ "id": "00000000-0000-0000-0000-000000000753",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000705",
+ "id": "00000000-0000-0000-0000-000000000754",
},
"type": {
- "id": "00000000-0000-0000-0000-000000000702",
+ "id": "00000000-0000-0000-0000-000000000751",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000703",
+ "id": "00000000-0000-0000-0000-000000000752",
},
},
"viewGroups": {},
@@ -2388,133 +2544,133 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"workflowRun": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000711",
+ "id": "00000000-0000-0000-0000-000000000760",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000722",
+ "id": "00000000-0000-0000-0000-000000000771",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000713",
+ "id": "00000000-0000-0000-0000-000000000762",
},
"endedAt": {
- "id": "00000000-0000-0000-0000-000000000719",
+ "id": "00000000-0000-0000-0000-000000000768",
},
"enqueuedAt": {
- "id": "00000000-0000-0000-0000-000000000717",
+ "id": "00000000-0000-0000-0000-000000000766",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000710",
+ "id": "00000000-0000-0000-0000-000000000759",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000714",
+ "id": "00000000-0000-0000-0000-000000000763",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000721",
+ "id": "00000000-0000-0000-0000-000000000770",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000727",
+ "id": "00000000-0000-0000-0000-000000000776",
},
"startedAt": {
- "id": "00000000-0000-0000-0000-000000000718",
+ "id": "00000000-0000-0000-0000-000000000767",
},
"state": {
- "id": "00000000-0000-0000-0000-000000000724",
+ "id": "00000000-0000-0000-0000-000000000773",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000720",
+ "id": "00000000-0000-0000-0000-000000000769",
},
"stepLogs": {
- "id": "00000000-0000-0000-0000-000000000725",
+ "id": "00000000-0000-0000-0000-000000000774",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000726",
+ "id": "00000000-0000-0000-0000-000000000775",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000712",
+ "id": "00000000-0000-0000-0000-000000000761",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000723",
+ "id": "00000000-0000-0000-0000-000000000772",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000716",
+ "id": "00000000-0000-0000-0000-000000000765",
},
"workflowVersion": {
- "id": "00000000-0000-0000-0000-000000000715",
+ "id": "00000000-0000-0000-0000-000000000764",
},
},
- "id": "00000000-0000-0000-0000-000000000750",
+ "id": "00000000-0000-0000-0000-000000000799",
"views": {
"allWorkflowRuns": {
- "id": "00000000-0000-0000-0000-000000000734",
+ "id": "00000000-0000-0000-0000-000000000783",
"viewFieldGroups": {},
"viewFields": {
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000732",
+ "id": "00000000-0000-0000-0000-000000000781",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000728",
+ "id": "00000000-0000-0000-0000-000000000777",
},
"startedAt": {
- "id": "00000000-0000-0000-0000-000000000731",
+ "id": "00000000-0000-0000-0000-000000000780",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000730",
+ "id": "00000000-0000-0000-0000-000000000779",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000729",
+ "id": "00000000-0000-0000-0000-000000000778",
},
"workflowVersion": {
- "id": "00000000-0000-0000-0000-000000000733",
+ "id": "00000000-0000-0000-0000-000000000782",
},
},
"viewGroups": {},
},
"workflowRunRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000749",
+ "id": "00000000-0000-0000-0000-000000000798",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000747",
+ "id": "00000000-0000-0000-0000-000000000796",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000748",
+ "id": "00000000-0000-0000-0000-000000000797",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000740",
+ "id": "00000000-0000-0000-0000-000000000789",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000741",
+ "id": "00000000-0000-0000-0000-000000000790",
},
"endedAt": {
- "id": "00000000-0000-0000-0000-000000000739",
+ "id": "00000000-0000-0000-0000-000000000788",
},
"enqueuedAt": {
- "id": "00000000-0000-0000-0000-000000000742",
+ "id": "00000000-0000-0000-0000-000000000791",
},
"startedAt": {
- "id": "00000000-0000-0000-0000-000000000738",
+ "id": "00000000-0000-0000-0000-000000000787",
},
"state": {
- "id": "00000000-0000-0000-0000-000000000743",
+ "id": "00000000-0000-0000-0000-000000000792",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000735",
+ "id": "00000000-0000-0000-0000-000000000784",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000746",
+ "id": "00000000-0000-0000-0000-000000000795",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000744",
+ "id": "00000000-0000-0000-0000-000000000793",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000745",
+ "id": "00000000-0000-0000-0000-000000000794",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000736",
+ "id": "00000000-0000-0000-0000-000000000785",
},
"workflowVersion": {
- "id": "00000000-0000-0000-0000-000000000737",
+ "id": "00000000-0000-0000-0000-000000000786",
},
},
"viewGroups": {},
@@ -2524,115 +2680,115 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"workflowVersion": {
"fields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000752",
+ "id": "00000000-0000-0000-0000-000000000801",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000764",
+ "id": "00000000-0000-0000-0000-000000000813",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000754",
+ "id": "00000000-0000-0000-0000-000000000803",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000751",
+ "id": "00000000-0000-0000-0000-000000000800",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000755",
+ "id": "00000000-0000-0000-0000-000000000804",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000759",
+ "id": "00000000-0000-0000-0000-000000000808",
},
"runs": {
- "id": "00000000-0000-0000-0000-000000000760",
+ "id": "00000000-0000-0000-0000-000000000809",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000763",
+ "id": "00000000-0000-0000-0000-000000000812",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000758",
+ "id": "00000000-0000-0000-0000-000000000807",
},
"steps": {
- "id": "00000000-0000-0000-0000-000000000761",
+ "id": "00000000-0000-0000-0000-000000000810",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000762",
+ "id": "00000000-0000-0000-0000-000000000811",
},
"trigger": {
- "id": "00000000-0000-0000-0000-000000000757",
+ "id": "00000000-0000-0000-0000-000000000806",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000753",
+ "id": "00000000-0000-0000-0000-000000000802",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000765",
+ "id": "00000000-0000-0000-0000-000000000814",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000756",
+ "id": "00000000-0000-0000-0000-000000000805",
},
},
- "id": "00000000-0000-0000-0000-000000000785",
+ "id": "00000000-0000-0000-0000-000000000834",
"views": {
"allWorkflowVersions": {
- "id": "00000000-0000-0000-0000-000000000771",
+ "id": "00000000-0000-0000-0000-000000000820",
"viewFieldGroups": {},
"viewFields": {
"name": {
- "id": "00000000-0000-0000-0000-000000000766",
+ "id": "00000000-0000-0000-0000-000000000815",
},
"runs": {
- "id": "00000000-0000-0000-0000-000000000770",
+ "id": "00000000-0000-0000-0000-000000000819",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000768",
+ "id": "00000000-0000-0000-0000-000000000817",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000769",
+ "id": "00000000-0000-0000-0000-000000000818",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000767",
+ "id": "00000000-0000-0000-0000-000000000816",
},
},
"viewGroups": {},
},
"workflowVersionRecordPageFields": {
- "id": "00000000-0000-0000-0000-000000000784",
+ "id": "00000000-0000-0000-0000-000000000833",
"viewFieldGroups": {
"general": {
- "id": "00000000-0000-0000-0000-000000000782",
+ "id": "00000000-0000-0000-0000-000000000831",
},
"system": {
- "id": "00000000-0000-0000-0000-000000000783",
+ "id": "00000000-0000-0000-0000-000000000832",
},
},
"viewFields": {
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000775",
+ "id": "00000000-0000-0000-0000-000000000824",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000777",
+ "id": "00000000-0000-0000-0000-000000000826",
},
"runs": {
- "id": "00000000-0000-0000-0000-000000000780",
+ "id": "00000000-0000-0000-0000-000000000829",
},
"status": {
- "id": "00000000-0000-0000-0000-000000000772",
+ "id": "00000000-0000-0000-0000-000000000821",
},
"steps": {
- "id": "00000000-0000-0000-0000-000000000776",
+ "id": "00000000-0000-0000-0000-000000000825",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000781",
+ "id": "00000000-0000-0000-0000-000000000830",
},
"trigger": {
- "id": "00000000-0000-0000-0000-000000000774",
+ "id": "00000000-0000-0000-0000-000000000823",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000778",
+ "id": "00000000-0000-0000-0000-000000000827",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000779",
+ "id": "00000000-0000-0000-0000-000000000828",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000773",
+ "id": "00000000-0000-0000-0000-000000000822",
},
},
"viewGroups": {},
@@ -2642,122 +2798,122 @@ exports[`getStandardObjectMetadataRelatedEntityIds should return standard object
"workspaceMember": {
"fields": {
"accountOwnerForCompanies": {
- "id": "00000000-0000-0000-0000-000000000799",
+ "id": "00000000-0000-0000-0000-000000000848",
},
"assignedTasks": {
- "id": "00000000-0000-0000-0000-000000000797",
+ "id": "00000000-0000-0000-0000-000000000846",
},
"avatarUrl": {
- "id": "00000000-0000-0000-0000-000000000794",
+ "id": "00000000-0000-0000-0000-000000000843",
},
"blocklist": {
- "id": "00000000-0000-0000-0000-000000000801",
+ "id": "00000000-0000-0000-0000-000000000850",
},
"calendarEventParticipants": {
- "id": "00000000-0000-0000-0000-000000000802",
+ "id": "00000000-0000-0000-0000-000000000851",
},
"calendarStartDay": {
- "id": "00000000-0000-0000-0000-000000000808",
+ "id": "00000000-0000-0000-0000-000000000857",
},
"colorScheme": {
- "id": "00000000-0000-0000-0000-000000000792",
+ "id": "00000000-0000-0000-0000-000000000841",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000787",
+ "id": "00000000-0000-0000-0000-000000000836",
},
"createdBy": {
- "id": "00000000-0000-0000-0000-000000000810",
+ "id": "00000000-0000-0000-0000-000000000859",
},
"dateFormat": {
- "id": "00000000-0000-0000-0000-000000000805",
+ "id": "00000000-0000-0000-0000-000000000854",
},
"deletedAt": {
- "id": "00000000-0000-0000-0000-000000000789",
+ "id": "00000000-0000-0000-0000-000000000838",
},
"id": {
- "id": "00000000-0000-0000-0000-000000000786",
+ "id": "00000000-0000-0000-0000-000000000835",
},
"locale": {
- "id": "00000000-0000-0000-0000-000000000793",
+ "id": "00000000-0000-0000-0000-000000000842",
},
"messageParticipants": {
- "id": "00000000-0000-0000-0000-000000000800",
+ "id": "00000000-0000-0000-0000-000000000849",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000791",
+ "id": "00000000-0000-0000-0000-000000000840",
},
"numberFormat": {
- "id": "00000000-0000-0000-0000-000000000809",
+ "id": "00000000-0000-0000-0000-000000000858",
},
"ownedOpportunities": {
- "id": "00000000-0000-0000-0000-000000000798",
+ "id": "00000000-0000-0000-0000-000000000847",
},
"position": {
- "id": "00000000-0000-0000-0000-000000000790",
+ "id": "00000000-0000-0000-0000-000000000839",
},
"searchVector": {
- "id": "00000000-0000-0000-0000-000000000807",
+ "id": "00000000-0000-0000-0000-000000000856",
},
"timeFormat": {
- "id": "00000000-0000-0000-0000-000000000806",
+ "id": "00000000-0000-0000-0000-000000000855",
},
"timeZone": {
- "id": "00000000-0000-0000-0000-000000000804",
+ "id": "00000000-0000-0000-0000-000000000853",
},
"timelineActivities": {
- "id": "00000000-0000-0000-0000-000000000803",
+ "id": "00000000-0000-0000-0000-000000000852",
},
"updatedAt": {
- "id": "00000000-0000-0000-0000-000000000788",
+ "id": "00000000-0000-0000-0000-000000000837",
},
"updatedBy": {
- "id": "00000000-0000-0000-0000-000000000811",
+ "id": "00000000-0000-0000-0000-000000000860",
},
"userEmail": {
- "id": "00000000-0000-0000-0000-000000000795",
+ "id": "00000000-0000-0000-0000-000000000844",
},
"userId": {
- "id": "00000000-0000-0000-0000-000000000796",
+ "id": "00000000-0000-0000-0000-000000000845",
},
},
- "id": "00000000-0000-0000-0000-000000000824",
+ "id": "00000000-0000-0000-0000-000000000873",
"views": {
"allWorkspaceMembers": {
- "id": "00000000-0000-0000-0000-000000000823",
+ "id": "00000000-0000-0000-0000-000000000872",
"viewFieldGroups": {},
"viewFields": {
"assignedTasks": {
- "id": "00000000-0000-0000-0000-000000000822",
+ "id": "00000000-0000-0000-0000-000000000871",
},
"avatarUrl": {
- "id": "00000000-0000-0000-0000-000000000814",
+ "id": "00000000-0000-0000-0000-000000000863",
},
"colorScheme": {
- "id": "00000000-0000-0000-0000-000000000815",
+ "id": "00000000-0000-0000-0000-000000000864",
},
"createdAt": {
- "id": "00000000-0000-0000-0000-000000000820",
+ "id": "00000000-0000-0000-0000-000000000869",
},
"dateFormat": {
- "id": "00000000-0000-0000-0000-000000000818",
+ "id": "00000000-0000-0000-0000-000000000867",
},
"locale": {
- "id": "00000000-0000-0000-0000-000000000816",
+ "id": "00000000-0000-0000-0000-000000000865",
},
"name": {
- "id": "00000000-0000-0000-0000-000000000812",
+ "id": "00000000-0000-0000-0000-000000000861",
},
"ownedOpportunities": {
- "id": "00000000-0000-0000-0000-000000000821",
+ "id": "00000000-0000-0000-0000-000000000870",
},
"timeFormat": {
- "id": "00000000-0000-0000-0000-000000000819",
+ "id": "00000000-0000-0000-0000-000000000868",
},
"timeZone": {
- "id": "00000000-0000-0000-0000-000000000817",
+ "id": "00000000-0000-0000-0000-000000000866",
},
"userEmail": {
- "id": "00000000-0000-0000-0000-000000000813",
+ "id": "00000000-0000-0000-0000-000000000862",
},
},
"viewGroups": {},
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap
index 30db7ef3e75..2164f4f318a 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/__tests__/__snapshots__/get-standard-page-layout-metadata-related-entity-ids.util.spec.ts.snap
@@ -153,77 +153,115 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
},
+ "messageCampaignRecordPage": {
+ "id": "00000000-0000-0000-0000-000000000048",
+ "tabs": {
+ "home": {
+ "id": "00000000-0000-0000-0000-000000000049",
+ "widgets": {
+ "fields": {
+ "id": "00000000-0000-0000-0000-000000000050",
+ },
+ "list": {
+ "id": "00000000-0000-0000-0000-000000000051",
+ },
+ "messages": {
+ "id": "00000000-0000-0000-0000-000000000053",
+ },
+ "recipients": {
+ "id": "00000000-0000-0000-0000-000000000052",
+ },
+ },
+ },
+ },
+ },
"messageChannelMessageAssociationMessageFolderRecordPage": {
- "id": "00000000-0000-0000-0000-000000000053",
+ "id": "00000000-0000-0000-0000-000000000059",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000054",
+ "id": "00000000-0000-0000-0000-000000000060",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000055",
+ "id": "00000000-0000-0000-0000-000000000061",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000056",
+ "id": "00000000-0000-0000-0000-000000000062",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000057",
+ "id": "00000000-0000-0000-0000-000000000063",
},
},
},
},
},
"messageChannelMessageAssociationRecordPage": {
- "id": "00000000-0000-0000-0000-000000000048",
+ "id": "00000000-0000-0000-0000-000000000054",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000049",
+ "id": "00000000-0000-0000-0000-000000000055",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000050",
+ "id": "00000000-0000-0000-0000-000000000056",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000051",
+ "id": "00000000-0000-0000-0000-000000000057",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000052",
+ "id": "00000000-0000-0000-0000-000000000058",
+ },
+ },
+ },
+ },
+ },
+ "messageListRecordPage": {
+ "id": "00000000-0000-0000-0000-000000000069",
+ "tabs": {
+ "home": {
+ "id": "00000000-0000-0000-0000-000000000070",
+ "widgets": {
+ "fields": {
+ "id": "00000000-0000-0000-0000-000000000071",
+ },
+ "members": {
+ "id": "00000000-0000-0000-0000-000000000072",
},
},
},
},
},
"messageParticipantRecordPage": {
- "id": "00000000-0000-0000-0000-000000000058",
+ "id": "00000000-0000-0000-0000-000000000064",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000059",
+ "id": "00000000-0000-0000-0000-000000000065",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000060",
+ "id": "00000000-0000-0000-0000-000000000066",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000061",
+ "id": "00000000-0000-0000-0000-000000000067",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000062",
+ "id": "00000000-0000-0000-0000-000000000068",
},
},
},
},
},
"messageThreadRecordPage": {
- "id": "00000000-0000-0000-0000-000000000063",
+ "id": "00000000-0000-0000-0000-000000000073",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000064",
+ "id": "00000000-0000-0000-0000-000000000074",
"widgets": {
"emailThread": {
- "id": "00000000-0000-0000-0000-000000000065",
+ "id": "00000000-0000-0000-0000-000000000075",
},
},
},
@@ -264,299 +302,302 @@ exports[`getStandardPageLayoutMetadataRelatedEntityIds should return standard pa
},
},
"noteRecordPage": {
- "id": "00000000-0000-0000-0000-000000000066",
+ "id": "00000000-0000-0000-0000-000000000076",
"tabs": {
"files": {
- "id": "00000000-0000-0000-0000-000000000074",
+ "id": "00000000-0000-0000-0000-000000000084",
"widgets": {
"files": {
- "id": "00000000-0000-0000-0000-000000000075",
+ "id": "00000000-0000-0000-0000-000000000085",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000067",
+ "id": "00000000-0000-0000-0000-000000000077",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000068",
+ "id": "00000000-0000-0000-0000-000000000078",
},
"noteRichText": {
- "id": "00000000-0000-0000-0000-000000000069",
+ "id": "00000000-0000-0000-0000-000000000079",
},
},
},
"note": {
- "id": "00000000-0000-0000-0000-000000000070",
+ "id": "00000000-0000-0000-0000-000000000080",
"widgets": {
"noteRichText": {
- "id": "00000000-0000-0000-0000-000000000071",
+ "id": "00000000-0000-0000-0000-000000000081",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000072",
+ "id": "00000000-0000-0000-0000-000000000082",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000073",
+ "id": "00000000-0000-0000-0000-000000000083",
},
},
},
},
},
"opportunityRecordPage": {
- "id": "00000000-0000-0000-0000-000000000076",
+ "id": "00000000-0000-0000-0000-000000000086",
"tabs": {
"calendar": {
- "id": "00000000-0000-0000-0000-000000000092",
+ "id": "00000000-0000-0000-0000-000000000102",
"widgets": {
"calendar": {
- "id": "00000000-0000-0000-0000-000000000093",
+ "id": "00000000-0000-0000-0000-000000000103",
},
},
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000090",
+ "id": "00000000-0000-0000-0000-000000000100",
"widgets": {
"emails": {
- "id": "00000000-0000-0000-0000-000000000091",
+ "id": "00000000-0000-0000-0000-000000000101",
},
},
},
"files": {
- "id": "00000000-0000-0000-0000-000000000088",
+ "id": "00000000-0000-0000-0000-000000000098",
"widgets": {
"files": {
- "id": "00000000-0000-0000-0000-000000000089",
+ "id": "00000000-0000-0000-0000-000000000099",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000077",
+ "id": "00000000-0000-0000-0000-000000000087",
"widgets": {
"company": {
- "id": "00000000-0000-0000-0000-000000000080",
+ "id": "00000000-0000-0000-0000-000000000090",
},
"fields": {
- "id": "00000000-0000-0000-0000-000000000078",
+ "id": "00000000-0000-0000-0000-000000000088",
},
"owner": {
- "id": "00000000-0000-0000-0000-000000000081",
+ "id": "00000000-0000-0000-0000-000000000091",
},
"pointOfContact": {
- "id": "00000000-0000-0000-0000-000000000079",
+ "id": "00000000-0000-0000-0000-000000000089",
},
},
},
"notes": {
- "id": "00000000-0000-0000-0000-000000000086",
+ "id": "00000000-0000-0000-0000-000000000096",
"widgets": {
"notes": {
- "id": "00000000-0000-0000-0000-000000000087",
+ "id": "00000000-0000-0000-0000-000000000097",
},
},
},
"tasks": {
- "id": "00000000-0000-0000-0000-000000000084",
+ "id": "00000000-0000-0000-0000-000000000094",
"widgets": {
"tasks": {
- "id": "00000000-0000-0000-0000-000000000085",
+ "id": "00000000-0000-0000-0000-000000000095",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000082",
+ "id": "00000000-0000-0000-0000-000000000092",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000083",
+ "id": "00000000-0000-0000-0000-000000000093",
},
},
},
},
},
"personRecordPage": {
- "id": "00000000-0000-0000-0000-000000000094",
+ "id": "00000000-0000-0000-0000-000000000104",
"tabs": {
"calendar": {
- "id": "00000000-0000-0000-0000-000000000109",
+ "id": "00000000-0000-0000-0000-000000000120",
"widgets": {
"calendar": {
- "id": "00000000-0000-0000-0000-000000000110",
+ "id": "00000000-0000-0000-0000-000000000121",
},
},
},
"emails": {
- "id": "00000000-0000-0000-0000-000000000107",
+ "id": "00000000-0000-0000-0000-000000000118",
"widgets": {
"emails": {
- "id": "00000000-0000-0000-0000-000000000108",
+ "id": "00000000-0000-0000-0000-000000000119",
},
},
},
"files": {
- "id": "00000000-0000-0000-0000-000000000105",
+ "id": "00000000-0000-0000-0000-000000000116",
"widgets": {
"files": {
- "id": "00000000-0000-0000-0000-000000000106",
+ "id": "00000000-0000-0000-0000-000000000117",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000095",
+ "id": "00000000-0000-0000-0000-000000000105",
"widgets": {
"company": {
- "id": "00000000-0000-0000-0000-000000000097",
+ "id": "00000000-0000-0000-0000-000000000107",
},
"fields": {
- "id": "00000000-0000-0000-0000-000000000096",
+ "id": "00000000-0000-0000-0000-000000000106",
+ },
+ "listMemberships": {
+ "id": "00000000-0000-0000-0000-000000000109",
},
"pointOfContactForOpportunities": {
- "id": "00000000-0000-0000-0000-000000000098",
+ "id": "00000000-0000-0000-0000-000000000108",
},
},
},
"notes": {
- "id": "00000000-0000-0000-0000-000000000103",
+ "id": "00000000-0000-0000-0000-000000000114",
"widgets": {
"notes": {
- "id": "00000000-0000-0000-0000-000000000104",
+ "id": "00000000-0000-0000-0000-000000000115",
},
},
},
"tasks": {
- "id": "00000000-0000-0000-0000-000000000101",
+ "id": "00000000-0000-0000-0000-000000000112",
"widgets": {
"tasks": {
- "id": "00000000-0000-0000-0000-000000000102",
+ "id": "00000000-0000-0000-0000-000000000113",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000099",
+ "id": "00000000-0000-0000-0000-000000000110",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000100",
+ "id": "00000000-0000-0000-0000-000000000111",
},
},
},
},
},
"taskRecordPage": {
- "id": "00000000-0000-0000-0000-000000000111",
+ "id": "00000000-0000-0000-0000-000000000122",
"tabs": {
"files": {
- "id": "00000000-0000-0000-0000-000000000119",
+ "id": "00000000-0000-0000-0000-000000000130",
"widgets": {
"files": {
- "id": "00000000-0000-0000-0000-000000000120",
+ "id": "00000000-0000-0000-0000-000000000131",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000112",
+ "id": "00000000-0000-0000-0000-000000000123",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000113",
+ "id": "00000000-0000-0000-0000-000000000124",
},
"taskRichText": {
- "id": "00000000-0000-0000-0000-000000000114",
+ "id": "00000000-0000-0000-0000-000000000125",
},
},
},
"note": {
- "id": "00000000-0000-0000-0000-000000000115",
+ "id": "00000000-0000-0000-0000-000000000126",
"widgets": {
"taskRichText": {
- "id": "00000000-0000-0000-0000-000000000116",
+ "id": "00000000-0000-0000-0000-000000000127",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000117",
+ "id": "00000000-0000-0000-0000-000000000128",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000118",
+ "id": "00000000-0000-0000-0000-000000000129",
},
},
},
},
},
"workflowAutomatedTriggerRecordPage": {
- "id": "00000000-0000-0000-0000-000000000124",
+ "id": "00000000-0000-0000-0000-000000000135",
"tabs": {
"home": {
- "id": "00000000-0000-0000-0000-000000000125",
+ "id": "00000000-0000-0000-0000-000000000136",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000126",
+ "id": "00000000-0000-0000-0000-000000000137",
},
},
},
"timeline": {
- "id": "00000000-0000-0000-0000-000000000127",
+ "id": "00000000-0000-0000-0000-000000000138",
"widgets": {
"timeline": {
- "id": "00000000-0000-0000-0000-000000000128",
+ "id": "00000000-0000-0000-0000-000000000139",
},
},
},
},
},
"workflowRecordPage": {
- "id": "00000000-0000-0000-0000-000000000121",
+ "id": "00000000-0000-0000-0000-000000000132",
"tabs": {
"flow": {
- "id": "00000000-0000-0000-0000-000000000122",
+ "id": "00000000-0000-0000-0000-000000000133",
"widgets": {
"workflow": {
- "id": "00000000-0000-0000-0000-000000000123",
+ "id": "00000000-0000-0000-0000-000000000134",
},
},
},
},
},
"workflowRunRecordPage": {
- "id": "00000000-0000-0000-0000-000000000135",
+ "id": "00000000-0000-0000-0000-000000000146",
"tabs": {
"flow": {
- "id": "00000000-0000-0000-0000-000000000139",
+ "id": "00000000-0000-0000-0000-000000000150",
"widgets": {
"workflowRun": {
- "id": "00000000-0000-0000-0000-000000000140",
+ "id": "00000000-0000-0000-0000-000000000151",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000136",
+ "id": "00000000-0000-0000-0000-000000000147",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000137",
+ "id": "00000000-0000-0000-0000-000000000148",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000138",
+ "id": "00000000-0000-0000-0000-000000000149",
},
},
},
},
},
"workflowVersionRecordPage": {
- "id": "00000000-0000-0000-0000-000000000129",
+ "id": "00000000-0000-0000-0000-000000000140",
"tabs": {
"flow": {
- "id": "00000000-0000-0000-0000-000000000133",
+ "id": "00000000-0000-0000-0000-000000000144",
"widgets": {
"workflowVersion": {
- "id": "00000000-0000-0000-0000-000000000134",
+ "id": "00000000-0000-0000-0000-000000000145",
},
},
},
"home": {
- "id": "00000000-0000-0000-0000-000000000130",
+ "id": "00000000-0000-0000-0000-000000000141",
"widgets": {
"fields": {
- "id": "00000000-0000-0000-0000-000000000131",
+ "id": "00000000-0000-0000-0000-000000000142",
},
"workflow": {
- "id": "00000000-0000-0000-0000-000000000132",
+ "id": "00000000-0000-0000-0000-000000000143",
},
},
},
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/build-standard-flat-field-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/build-standard-flat-field-metadata-maps.util.ts
index cdc1558546c..128e8af7847 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/build-standard-flat-field-metadata-maps.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/build-standard-flat-field-metadata-maps.util.ts
@@ -13,6 +13,9 @@ import { buildCalendarEventStandardFlatFieldMetadatas } from 'src/engine/workspa
import { buildCallRecordingStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-call-recording-standard-flat-field-metadata.util';
import { buildCompanyStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-company-standard-flat-field-metadata.util';
import { buildDashboardStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-dashboard-standard-flat-field-metadata.util';
+import { buildMessageCampaignStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-campaign-standard-flat-field-metadata.util';
+import { buildMessageListStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-list-standard-flat-field-metadata.util';
+import { buildMessageListMemberStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-list-member-standard-flat-field-metadata.util';
import { buildMessageChannelMessageAssociationMessageFolderStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-message-association-message-folder-standard-flat-field-metadata.util';
import { buildMessageChannelMessageAssociationStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-channel-message-association-standard-flat-field-metadata.util';
import { buildMessageParticipantStandardFlatFieldMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-participant-standard-flat-field-metadata.util';
@@ -47,6 +50,9 @@ const STANDARD_FLAT_FIELD_METADATA_BUILDERS_BY_OBJECT_NAME = {
callRecording: buildCallRecordingStandardFlatFieldMetadatas,
company: buildCompanyStandardFlatFieldMetadatas,
dashboard: buildDashboardStandardFlatFieldMetadatas,
+ messageCampaign: buildMessageCampaignStandardFlatFieldMetadatas,
+ messageList: buildMessageListStandardFlatFieldMetadatas,
+ messageListMember: buildMessageListMemberStandardFlatFieldMetadatas,
message: buildMessageStandardFlatFieldMetadatas,
messageChannelMessageAssociation:
buildMessageChannelMessageAssociationStandardFlatFieldMetadatas,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-campaign-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-campaign-standard-flat-field-metadata.util.ts
new file mode 100644
index 00000000000..6a2d270fe2a
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-campaign-standard-flat-field-metadata.util.ts
@@ -0,0 +1,361 @@
+import { msg } from '@lingui/core/macro';
+import { i18nLabel } from 'src/engine/workspace-manager/twenty-standard-application/utils/i18n-label.util';
+import {
+ DateDisplayFormat,
+ FieldMetadataType,
+ RelationOnDeleteAction,
+ RelationType,
+} from 'twenty-shared/types';
+
+import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
+import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
+import {
+ type CreateStandardFieldArgs,
+ createStandardFieldFlatMetadata,
+} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
+import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
+import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
+import { SEARCH_FIELDS_FOR_MESSAGE_CAMPAIGN } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
+
+export const buildMessageCampaignStandardFlatFieldMetadatas = ({
+ now,
+ objectName,
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+}: Omit<
+ CreateStandardFieldArgs<'messageCampaign', FieldMetadataType>,
+ 'context'
+>): Record<
+ AllStandardObjectFieldName<'messageCampaign'>,
+ FlatFieldMetadata
+> => {
+ const base = {
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ objectName,
+ workspaceId,
+ };
+
+ return {
+ id: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'id',
+ type: FieldMetadataType.UUID,
+ label: i18nLabel(msg`Id`),
+ description: i18nLabel(msg`Id`),
+ icon: 'Icon123',
+ isSystem: true,
+ isNullable: false,
+ isUIEditable: false,
+ defaultValue: 'uuid',
+ },
+ }),
+ createdAt: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'createdAt',
+ type: FieldMetadataType.DATE_TIME,
+ label: i18nLabel(msg`Creation date`),
+ description: i18nLabel(msg`Creation date`),
+ icon: 'IconCalendar',
+ isSystem: true,
+ isNullable: false,
+ isUIEditable: false,
+ defaultValue: 'now',
+ settings: { displayFormat: DateDisplayFormat.RELATIVE },
+ },
+ }),
+ updatedAt: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'updatedAt',
+ type: FieldMetadataType.DATE_TIME,
+ label: i18nLabel(msg`Last update`),
+ description: i18nLabel(msg`Last time the record was changed`),
+ icon: 'IconCalendarClock',
+ isSystem: true,
+ isNullable: false,
+ isUIEditable: false,
+ defaultValue: 'now',
+ settings: { displayFormat: DateDisplayFormat.RELATIVE },
+ },
+ }),
+ deletedAt: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'deletedAt',
+ type: FieldMetadataType.DATE_TIME,
+ label: i18nLabel(msg`Deleted at`),
+ description: i18nLabel(msg`Date when the record was deleted`),
+ icon: 'IconCalendarMinus',
+ isSystem: true,
+ isNullable: true,
+ isUIEditable: false,
+ settings: { displayFormat: DateDisplayFormat.RELATIVE },
+ },
+ }),
+ createdBy: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'createdBy',
+ type: FieldMetadataType.ACTOR,
+ label: i18nLabel(msg`Created by`),
+ description: i18nLabel(msg`The creator of the record`),
+ icon: 'IconCreativeCommonsSa',
+ isSystem: true,
+ isUIEditable: false,
+ isNullable: false,
+ defaultValue: {
+ source: "'MANUAL'",
+ name: "'System'",
+ workspaceMemberId: null,
+ },
+ },
+ }),
+ updatedBy: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'updatedBy',
+ type: FieldMetadataType.ACTOR,
+ label: i18nLabel(msg`Updated by`),
+ description: i18nLabel(
+ msg`The workspace member who last updated the record`,
+ ),
+ icon: 'IconUserCircle',
+ isSystem: true,
+ isUIEditable: false,
+ isNullable: false,
+ defaultValue: {
+ source: "'MANUAL'",
+ name: "'System'",
+ workspaceMemberId: null,
+ },
+ },
+ }),
+ position: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'position',
+ type: FieldMetadataType.POSITION,
+ label: i18nLabel(msg`Position`),
+ description: i18nLabel(msg`Email campaign record position`),
+ icon: 'IconHierarchy2',
+ isSystem: true,
+ isNullable: false,
+ defaultValue: 0,
+ },
+ }),
+ searchVector: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'searchVector',
+ type: FieldMetadataType.TS_VECTOR,
+ label: i18nLabel(msg`Search vector`),
+ description: i18nLabel(msg`Field used for full-text search`),
+ icon: 'IconSend',
+ isSystem: true,
+ isNullable: true,
+ settings: {
+ generatedType: 'STORED',
+ asExpression: getTsVectorColumnExpressionFromFields(
+ SEARCH_FIELDS_FOR_MESSAGE_CAMPAIGN,
+ ),
+ },
+ },
+ }),
+ subject: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'subject',
+ type: FieldMetadataType.TEXT,
+ label: i18nLabel(msg`Subject`),
+ description: i18nLabel(msg`Email subject line`),
+ icon: 'IconMail',
+ isNullable: true,
+ isUIEditable: false,
+ },
+ }),
+ bodyTemplate: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'bodyTemplate',
+ type: FieldMetadataType.TEXT,
+ label: i18nLabel(msg`Body`),
+ description: i18nLabel(msg`Email body sent to recipients`),
+ icon: 'IconFileText',
+ isNullable: true,
+ isUIEditable: false,
+ },
+ }),
+ fromAddress: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'fromAddress',
+ type: FieldMetadataType.EMAILS,
+ label: i18nLabel(msg`From address`),
+ description: i18nLabel(msg`Sender address for the campaign`),
+ icon: 'IconAt',
+ isNullable: true,
+ isUIEditable: false,
+ settings: {
+ maxNumberOfValues: 1,
+ },
+ },
+ }),
+ status: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'status',
+ type: FieldMetadataType.SELECT,
+ label: i18nLabel(msg`Status`),
+ description: i18nLabel(msg`Campaign lifecycle status`),
+ icon: 'IconProgress',
+ isNullable: false,
+ isUIEditable: false,
+ defaultValue: "'DRAFT'",
+ options: [
+ {
+ id: '2bebe786-69e0-4673-8781-a85588b77c44',
+ value: 'DRAFT',
+ label: i18nLabel(msg`Draft`),
+ position: 0,
+ color: 'gray',
+ },
+ {
+ id: 'dba0c513-d1dc-4c6a-980a-40795bdb0759',
+ value: 'SCHEDULED',
+ label: i18nLabel(msg`Scheduled`),
+ position: 1,
+ color: 'blue',
+ },
+ {
+ id: '575b9ed5-1123-480c-9821-c73410841347',
+ value: 'SENDING',
+ label: i18nLabel(msg`Sending`),
+ position: 2,
+ color: 'yellow',
+ },
+ {
+ id: '0c311eae-0892-4319-84e6-b30e921dc01a',
+ value: 'SENT',
+ label: i18nLabel(msg`Sent`),
+ position: 3,
+ color: 'green',
+ },
+ {
+ id: 'c309536c-ceb7-4510-8481-c2cbd88ffe96',
+ value: 'SENT_WITH_ERRORS',
+ label: i18nLabel(msg`Sent with errors`),
+ position: 4,
+ color: 'orange',
+ },
+ ],
+ },
+ }),
+ sentAt: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'sentAt',
+ type: FieldMetadataType.DATE_TIME,
+ label: i18nLabel(msg`Sent at`),
+ description: i18nLabel(msg`When the campaign finished sending`),
+ icon: 'IconSend',
+ isNullable: true,
+ isUIEditable: false,
+ settings: { displayFormat: DateDisplayFormat.RELATIVE },
+ },
+ }),
+ unsubscribeTopicId: createStandardFieldFlatMetadata({
+ ...base,
+ context: {
+ fieldName: 'unsubscribeTopicId',
+ type: FieldMetadataType.UUID,
+ label: i18nLabel(msg`Unsubscribe topic id`),
+ description: i18nLabel(
+ msg`The unsubscribe topic this campaign was sent under`,
+ ),
+ icon: 'IconMailbox',
+ isNullable: true,
+ isUIEditable: false,
+ },
+ }),
+ list: createStandardRelationFieldFlatMetadata({
+ ...base,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'list',
+ label: i18nLabel(msg`List`),
+ description: i18nLabel(msg`The list this campaign was sent to`),
+ icon: 'IconUsersGroup',
+ isNullable: true,
+ isUIEditable: false,
+ targetObjectName: 'messageList',
+ targetFieldName: 'campaigns',
+ settings: {
+ relationType: RelationType.MANY_TO_ONE,
+ onDelete: RelationOnDeleteAction.SET_NULL,
+ joinColumnName: 'listId',
+ },
+ },
+ }),
+ timelineActivities: createStandardRelationFieldFlatMetadata({
+ ...base,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'timelineActivities',
+ label: i18nLabel(msg`Events`),
+ description: i18nLabel(msg`Events linked to the campaign`),
+ icon: 'IconTimelineEvent',
+ isNullable: true,
+ targetObjectName: 'timelineActivity',
+ targetFieldName: 'targetMessageCampaign',
+ settings: {
+ relationType: RelationType.ONE_TO_MANY,
+ },
+ },
+ }),
+ messages: createStandardRelationFieldFlatMetadata({
+ ...base,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'messages',
+ label: i18nLabel(msg`Messages`),
+ description: i18nLabel(msg`Messages sent as part of this campaign`),
+ icon: 'IconMessage',
+ isNullable: true,
+ isUIEditable: false,
+ targetObjectName: 'message',
+ targetFieldName: 'messageCampaign',
+ settings: {
+ relationType: RelationType.ONE_TO_MANY,
+ },
+ },
+ }),
+ recipients: createStandardRelationFieldFlatMetadata({
+ ...base,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'recipients',
+ label: i18nLabel(msg`Recipients`),
+ description: i18nLabel(msg`The people this campaign was sent to`),
+ icon: 'IconUsers',
+ isNullable: true,
+ isUIEditable: false,
+ targetObjectName: 'messageParticipant',
+ targetFieldName: 'messageCampaign',
+ settings: {
+ relationType: RelationType.ONE_TO_MANY,
+ },
+ },
+ }),
+ };
+};
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-list-member-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-list-member-standard-flat-field-metadata.util.ts
new file mode 100644
index 00000000000..d7e4e3ece98
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-list-member-standard-flat-field-metadata.util.ts
@@ -0,0 +1,248 @@
+import { msg } from '@lingui/core/macro';
+import { i18nLabel } from 'src/engine/workspace-manager/twenty-standard-application/utils/i18n-label.util';
+import {
+ DateDisplayFormat,
+ FieldMetadataType,
+ RelationOnDeleteAction,
+ RelationType,
+} from 'twenty-shared/types';
+
+import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
+import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
+import {
+ type CreateStandardFieldArgs,
+ createStandardFieldFlatMetadata,
+} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
+import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
+import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
+
+export const buildMessageListMemberStandardFlatFieldMetadatas = ({
+ now,
+ objectName,
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+}: Omit<
+ CreateStandardFieldArgs<'messageListMember', FieldMetadataType>,
+ 'context'
+>): Record<
+ AllStandardObjectFieldName<'messageListMember'>,
+ FlatFieldMetadata
+> => ({
+ id: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'id',
+ type: FieldMetadataType.UUID,
+ label: i18nLabel(msg`Id`),
+ description: i18nLabel(msg`Id`),
+ icon: 'Icon123',
+ isSystem: true,
+ isNullable: false,
+ isUIEditable: false,
+ defaultValue: 'uuid',
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ createdAt: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'createdAt',
+ type: FieldMetadataType.DATE_TIME,
+ label: i18nLabel(msg`Creation date`),
+ description: i18nLabel(msg`Creation date`),
+ icon: 'IconCalendar',
+ isSystem: true,
+ isNullable: false,
+ isUIEditable: false,
+ defaultValue: 'now',
+ settings: { displayFormat: DateDisplayFormat.RELATIVE },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ updatedAt: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'updatedAt',
+ type: FieldMetadataType.DATE_TIME,
+ label: i18nLabel(msg`Last update`),
+ description: i18nLabel(msg`Last time the record was changed`),
+ icon: 'IconCalendarClock',
+ isSystem: true,
+ isNullable: false,
+ isUIEditable: false,
+ defaultValue: 'now',
+ settings: { displayFormat: DateDisplayFormat.RELATIVE },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ deletedAt: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'deletedAt',
+ type: FieldMetadataType.DATE_TIME,
+ label: i18nLabel(msg`Deleted at`),
+ description: i18nLabel(msg`Date when the record was deleted`),
+ icon: 'IconCalendarMinus',
+ isSystem: true,
+ isNullable: true,
+ isUIEditable: false,
+ settings: { displayFormat: DateDisplayFormat.RELATIVE },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ createdBy: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'createdBy',
+ type: FieldMetadataType.ACTOR,
+ label: i18nLabel(msg`Created by`),
+ description: i18nLabel(msg`The creator of the record`),
+ icon: 'IconCreativeCommonsSa',
+ isSystem: true,
+ isUIEditable: false,
+ isNullable: false,
+ defaultValue: {
+ source: "'MANUAL'",
+ name: "'System'",
+ workspaceMemberId: null,
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ updatedBy: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'updatedBy',
+ type: FieldMetadataType.ACTOR,
+ label: i18nLabel(msg`Updated by`),
+ description: i18nLabel(
+ msg`The workspace member who last updated the record`,
+ ),
+ icon: 'IconUserCircle',
+ isSystem: true,
+ isUIEditable: false,
+ isNullable: false,
+ defaultValue: {
+ source: "'MANUAL'",
+ name: "'System'",
+ workspaceMemberId: null,
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ position: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'position',
+ type: FieldMetadataType.POSITION,
+ label: i18nLabel(msg`Position`),
+ description: i18nLabel(msg`List member record position`),
+ icon: 'IconHierarchy2',
+ isSystem: true,
+ isNullable: false,
+ defaultValue: 0,
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ list: createStandardRelationFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'list',
+ label: i18nLabel(msg`List`),
+ description: i18nLabel(msg`The list the person belongs to`),
+ icon: 'IconUsersGroup',
+ isNullable: false,
+ targetObjectName: 'messageList',
+ targetFieldName: 'members',
+ settings: {
+ relationType: RelationType.MANY_TO_ONE,
+ onDelete: RelationOnDeleteAction.CASCADE,
+ joinColumnName: 'listId',
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ person: createStandardRelationFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'person',
+ label: i18nLabel(msg`Person`),
+ description: i18nLabel(msg`The person in the list`),
+ icon: 'IconUser',
+ isNullable: false,
+ targetObjectName: 'person',
+ targetFieldName: 'listMemberships',
+ settings: {
+ relationType: RelationType.MANY_TO_ONE,
+ onDelete: RelationOnDeleteAction.CASCADE,
+ joinColumnName: 'personId',
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ searchVector: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'searchVector',
+ type: FieldMetadataType.TS_VECTOR,
+ label: i18nLabel(msg`Search vector`),
+ description: i18nLabel(msg`Field used for full-text search`),
+ icon: 'IconUser',
+ isSystem: true,
+ isNullable: true,
+ settings: {
+ generatedType: 'STORED',
+ asExpression: getTsVectorColumnExpressionFromFields([
+ { name: 'id', type: FieldMetadataType.UUID },
+ ]),
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+});
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-list-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-list-standard-flat-field-metadata.util.ts
new file mode 100644
index 00000000000..3d1c92836f5
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-list-standard-flat-field-metadata.util.ts
@@ -0,0 +1,284 @@
+import { msg } from '@lingui/core/macro';
+import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
+
+import { i18nLabel } from 'src/engine/workspace-manager/twenty-standard-application/utils/i18n-label.util';
+import {
+ DateDisplayFormat,
+ FieldMetadataType,
+ RelationType,
+} from 'twenty-shared/types';
+
+import { type FlatFieldMetadata } from 'src/engine/metadata-modules/flat-field-metadata/types/flat-field-metadata.type';
+import { type AllStandardObjectFieldName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-field-name.type';
+import {
+ type CreateStandardFieldArgs,
+ createStandardFieldFlatMetadata,
+} from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-field-flat-metadata.util';
+import { createStandardRelationFieldFlatMetadata } from 'src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util';
+import { getTsVectorColumnExpressionFromFields } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
+import { SEARCH_FIELDS_FOR_MESSAGE_LIST } from 'src/modules/emailing/standard-objects/message-list.workspace-entity';
+
+export const buildMessageListStandardFlatFieldMetadatas = ({
+ now,
+ objectName,
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+}: Omit<
+ CreateStandardFieldArgs<'messageList', FieldMetadataType>,
+ 'context'
+>): Record<AllStandardObjectFieldName<'messageList'>, FlatFieldMetadata> => ({
+ id: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'id',
+ type: FieldMetadataType.UUID,
+ label: i18nLabel(msg`Id`),
+ description: i18nLabel(msg`Id`),
+ icon: 'Icon123',
+ isSystem: true,
+ isNullable: false,
+ isUIEditable: false,
+ defaultValue: 'uuid',
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ createdAt: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'createdAt',
+ type: FieldMetadataType.DATE_TIME,
+ label: i18nLabel(msg`Creation date`),
+ description: i18nLabel(msg`Creation date`),
+ icon: 'IconCalendar',
+ isSystem: true,
+ isNullable: false,
+ isUIEditable: false,
+ defaultValue: 'now',
+ settings: { displayFormat: DateDisplayFormat.RELATIVE },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ updatedAt: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'updatedAt',
+ type: FieldMetadataType.DATE_TIME,
+ label: i18nLabel(msg`Last update`),
+ description: i18nLabel(msg`Last time the record was changed`),
+ icon: 'IconCalendarClock',
+ isSystem: true,
+ isNullable: false,
+ isUIEditable: false,
+ defaultValue: 'now',
+ settings: { displayFormat: DateDisplayFormat.RELATIVE },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ deletedAt: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'deletedAt',
+ type: FieldMetadataType.DATE_TIME,
+ label: i18nLabel(msg`Deleted at`),
+ description: i18nLabel(msg`Date when the record was deleted`),
+ icon: 'IconCalendarMinus',
+ isSystem: true,
+ isNullable: true,
+ isUIEditable: false,
+ settings: { displayFormat: DateDisplayFormat.RELATIVE },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ createdBy: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'createdBy',
+ type: FieldMetadataType.ACTOR,
+ label: i18nLabel(msg`Created by`),
+ description: i18nLabel(msg`The creator of the record`),
+ icon: 'IconCreativeCommonsSa',
+ isSystem: true,
+ isUIEditable: false,
+ isNullable: false,
+ defaultValue: {
+ source: "'MANUAL'",
+ name: "'System'",
+ workspaceMemberId: null,
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ updatedBy: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'updatedBy',
+ type: FieldMetadataType.ACTOR,
+ label: i18nLabel(msg`Updated by`),
+ description: i18nLabel(
+ msg`The workspace member who last updated the record`,
+ ),
+ icon: 'IconUserCircle',
+ isSystem: true,
+ isUIEditable: false,
+ isNullable: false,
+ defaultValue: {
+ source: "'MANUAL'",
+ name: "'System'",
+ workspaceMemberId: null,
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ position: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'position',
+ type: FieldMetadataType.POSITION,
+ label: i18nLabel(msg`Position`),
+ description: i18nLabel(msg`List record position`),
+ icon: 'IconHierarchy2',
+ isSystem: true,
+ isNullable: false,
+ defaultValue: 0,
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ name: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'name',
+ type: FieldMetadataType.TEXT,
+ label: i18nLabel(msg`Name`),
+ description: i18nLabel(msg`The list name`),
+ icon: 'IconUsersGroup',
+ isNullable: true,
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ members: createStandardRelationFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'members',
+ label: i18nLabel(msg`Members`),
+ description: i18nLabel(msg`People in this list`),
+ icon: 'IconUser',
+ isNullable: true,
+ targetObjectName: 'messageListMember',
+ targetFieldName: 'list',
+ settings: {
+ relationType: RelationType.ONE_TO_MANY,
+ },
+ junctionTargetFieldUniversalIdentifier:
+ STANDARD_OBJECTS.messageListMember.fields.person.universalIdentifier,
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ campaigns: createStandardRelationFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'campaigns',
+ label: i18nLabel(msg`Campaigns`),
+ description: i18nLabel(msg`Campaigns sent to this list`),
+ icon: 'IconSend',
+ isUIEditable: false,
+ isNullable: true,
+ targetObjectName: 'messageCampaign',
+ targetFieldName: 'list',
+ settings: {
+ relationType: RelationType.ONE_TO_MANY,
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ timelineActivities: createStandardRelationFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'timelineActivities',
+ label: i18nLabel(msg`Events`),
+ description: i18nLabel(msg`Events linked to the list`),
+ icon: 'IconTimelineEvent',
+ isNullable: true,
+ targetObjectName: 'timelineActivity',
+ targetFieldName: 'targetMessageList',
+ settings: {
+ relationType: RelationType.ONE_TO_MANY,
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ searchVector: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'searchVector',
+ type: FieldMetadataType.TS_VECTOR,
+ label: i18nLabel(msg`Search vector`),
+ description: i18nLabel(msg`Field used for full-text search`),
+ icon: 'IconUsersGroup',
+ isSystem: true,
+ isNullable: true,
+ settings: {
+ generatedType: 'STORED',
+ asExpression: getTsVectorColumnExpressionFromFields(
+ SEARCH_FIELDS_FOR_MESSAGE_LIST,
+ ),
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+});
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-participant-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-participant-standard-flat-field-metadata.util.ts
index 5605aa214eb..8649fbc096a 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-participant-standard-flat-field-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-participant-standard-flat-field-metadata.util.ts
@@ -356,4 +356,31 @@ export const buildMessageParticipantStandardFlatFieldMetadatas = ({
twentyStandardApplicationId,
now,
}),
+ messageCampaign: createStandardRelationFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'messageCampaign',
+ label: i18nLabel(msg`Campaign`),
+ description: i18nLabel(
+ msg`The campaign this participant was a recipient of`,
+ ),
+ icon: 'IconSend',
+ isNullable: true,
+ isUIEditable: false,
+ targetObjectName: 'messageCampaign',
+ targetFieldName: 'recipients',
+ settings: {
+ relationType: RelationType.MANY_TO_ONE,
+ onDelete: RelationOnDeleteAction.SET_NULL,
+ joinColumnName: 'messageCampaignId',
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
});
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-standard-flat-field-metadata.util.ts
index 27665227e29..c4c685d5a40 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-standard-flat-field-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-message-standard-flat-field-metadata.util.ts
@@ -334,4 +334,94 @@ export const buildMessageStandardFlatFieldMetadatas = ({
twentyStandardApplicationId,
now,
}),
+ messageCampaign: createStandardRelationFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'messageCampaign',
+ label: i18nLabel(msg`Campaign`),
+ description: i18nLabel(
+ msg`The campaign this message was sent as part of`,
+ ),
+ icon: 'IconSend',
+ isNullable: true,
+ isUIEditable: false,
+ targetObjectName: 'messageCampaign',
+ targetFieldName: 'messages',
+ settings: {
+ relationType: RelationType.MANY_TO_ONE,
+ onDelete: RelationOnDeleteAction.SET_NULL,
+ joinColumnName: 'messageCampaignId',
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ deliveryStatus: createStandardFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ fieldName: 'deliveryStatus',
+ type: FieldMetadataType.SELECT,
+ label: i18nLabel(msg`Delivery status`),
+ description: i18nLabel(
+ msg`Per-recipient delivery status for campaign sends`,
+ ),
+ icon: 'IconMailFast',
+ isNullable: true,
+ isUIEditable: false,
+ options: [
+ {
+ id: '6b189ac2-5054-45c0-a95b-25764e978d81',
+ value: 'QUEUED',
+ label: i18nLabel(msg`Queued`),
+ position: 0,
+ color: 'gray',
+ },
+ {
+ id: 'af7390a3-bd35-480b-9bc2-6f7d8589b3d2',
+ value: 'SENT',
+ label: i18nLabel(msg`Sent`),
+ position: 1,
+ color: 'green',
+ },
+ {
+ id: '39c934fc-01d7-48fa-9b79-8e19f75dab03',
+ value: 'FAILED',
+ label: i18nLabel(msg`Failed`),
+ position: 2,
+ color: 'red',
+ },
+ {
+ id: 'ade2b01f-8f10-43c6-ab3d-63b0d98ce40c',
+ value: 'BOUNCED',
+ label: i18nLabel(msg`Bounced`),
+ position: 3,
+ color: 'orange',
+ },
+ {
+ id: 'ae79b7bc-b416-4fd2-a366-ab8d91cb22da',
+ value: 'COMPLAINED',
+ label: i18nLabel(msg`Complained`),
+ position: 4,
+ color: 'purple',
+ },
+ {
+ id: 'c0d3f2a1-7e64-4b9a-8f21-1d5e6a7b8c90',
+ value: 'SKIPPED',
+ label: i18nLabel(msg`Skipped`),
+ position: 5,
+ color: 'yellow',
+ },
+ ],
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
});
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-person-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-person-standard-flat-field-metadata.util.ts
index e4d8932d21b..ad63099bbd6 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-person-standard-flat-field-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-person-standard-flat-field-metadata.util.ts
@@ -1,4 +1,6 @@
import { msg } from '@lingui/core/macro';
+import { STANDARD_OBJECTS } from 'twenty-shared/metadata';
+
import { i18nLabel } from 'src/engine/workspace-manager/twenty-standard-application/utils/i18n-label.util';
import {
DateDisplayFormat,
@@ -490,6 +492,31 @@ export const buildPersonStandardFlatFieldMetadatas = ({
twentyStandardApplicationId,
now,
}),
+ listMemberships: createStandardRelationFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ type: FieldMetadataType.RELATION,
+ morphId: null,
+ fieldName: 'listMemberships',
+ label: i18nLabel(msg`Lists`),
+ description: i18nLabel(msg`Lists the contact belongs to`),
+ icon: 'IconUsersGroup',
+ isUIEditable: true,
+ isNullable: true,
+ targetObjectName: 'messageListMember',
+ targetFieldName: 'person',
+ settings: {
+ relationType: RelationType.ONE_TO_MANY,
+ },
+ junctionTargetFieldUniversalIdentifier:
+ STANDARD_OBJECTS.messageListMember.fields.list.universalIdentifier,
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
searchVector: createStandardFieldFlatMetadata({
objectName,
workspaceId,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-timeline-activity-standard-flat-field-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-timeline-activity-standard-flat-field-metadata.util.ts
index 883d7e10b2c..465a2435c31 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-timeline-activity-standard-flat-field-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/compute-timeline-activity-standard-flat-field-metadata.util.ts
@@ -536,6 +536,56 @@ export const buildTimelineActivityStandardFlatFieldMetadatas = ({
twentyStandardApplicationId,
now,
}),
+ targetMessageList: createStandardRelationFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ type: FieldMetadataType.MORPH_RELATION,
+ morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
+ fieldName: 'targetMessageList',
+ label: i18nLabel(msg`Target`),
+ description: i18nLabel(msg`Event target`),
+ icon: 'IconArrowUpRight',
+ isNullable: true,
+ isUIEditable: false,
+ targetObjectName: 'messageList',
+ targetFieldName: 'timelineActivities',
+ settings: {
+ relationType: RelationType.MANY_TO_ONE,
+ onDelete: RelationOnDeleteAction.SET_NULL,
+ joinColumnName: 'targetMessageListId',
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ targetMessageCampaign: createStandardRelationFieldFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ type: FieldMetadataType.MORPH_RELATION,
+ morphId: STANDARD_OBJECTS.timelineActivity.morphIds.targetMorphId.morphId,
+ fieldName: 'targetMessageCampaign',
+ label: i18nLabel(msg`Target`),
+ description: i18nLabel(msg`Event target`),
+ icon: 'IconArrowUpRight',
+ isNullable: true,
+ isUIEditable: false,
+ targetObjectName: 'messageCampaign',
+ targetFieldName: 'timelineActivities',
+ settings: {
+ relationType: RelationType.MANY_TO_ONE,
+ onDelete: RelationOnDeleteAction.SET_NULL,
+ joinColumnName: 'targetMessageCampaignId',
+ },
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
searchVector: createStandardFieldFlatMetadata({
objectName,
workspaceId,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util.ts
index 1388714fc77..584afc1f048 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/field-metadata/create-standard-relation-field-flat-metadata.util.ts
@@ -40,6 +40,7 @@ export type CreateStandardMorphOrRelationFieldContext<
settings: FieldMetadataSettings<F>;
options?: FieldMetadataDefaultOption[] | FieldMetadataComplexOption[] | null;
morphId: F extends FieldMetadataType.MORPH_RELATION ? string : null;
+ junctionTargetFieldUniversalIdentifier?: string;
};
export type CreateStandardRelationFieldArgs<
@@ -70,6 +71,7 @@ export const createStandardRelationFieldFlatMetadata = <
options: fieldOptions = null,
morphId,
type,
+ junctionTargetFieldUniversalIdentifier,
},
standardObjectMetadataRelatedEntityIds,
twentyStandardApplicationId,
@@ -135,6 +137,11 @@ export const createStandardRelationFieldFlatMetadata = <
mainGroupByFieldMetadataViewUniversalIdentifiers: [],
viewSortIds: [],
viewSortUniversalIdentifiers: [],
- universalSettings: settings,
+ universalSettings: {
+ ...settings,
+ ...(junctionTargetFieldUniversalIdentifier && {
+ junctionTargetFieldUniversalIdentifier,
+ }),
+ },
};
};
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/get-standard-object-metadata-related-entity-ids.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/get-standard-object-metadata-related-entity-ids.util.ts
index 8653f16e9a9..9e35466dbec 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/get-standard-object-metadata-related-entity-ids.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/get-standard-object-metadata-related-entity-ids.util.ts
@@ -35,7 +35,7 @@ const computeStandardViewObjectIds = <O extends AllStandardObjectName>({
}): StandardObjectViewIds<O> | undefined => {
const objectDefinition = STANDARD_OBJECTS[objectName];
- if (!Object.prototype.hasOwnProperty.call(objectDefinition, 'views')) {
+ if (!('views' in objectDefinition)) {
return undefined;
}
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/build-standard-flat-index-metadata-maps.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/build-standard-flat-index-metadata-maps.util.ts
index ca60f5c7415..d61bbe2e568 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/build-standard-flat-index-metadata-maps.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/build-standard-flat-index-metadata-maps.util.ts
@@ -10,6 +10,9 @@ import { buildCalendarEventParticipantStandardFlatIndexMetadatas } from 'src/eng
import { buildCallRecordingStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-call-recording-standard-flat-index-metadata.util';
import { buildCompanyStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-company-standard-flat-index-metadata.util';
import { buildDashboardStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-dashboard-standard-flat-index-metadata.util';
+import { buildMessageCampaignStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-campaign-standard-flat-index-metadata.util';
+import { buildMessageListStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-list-standard-flat-index-metadata.util';
+import { buildMessageListMemberStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-list-member-standard-flat-index-metadata.util';
import { buildMessageChannelMessageAssociationMessageFolderStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-message-association-message-folder-standard-flat-index-metadata.util';
import { buildMessageChannelMessageAssociationStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-channel-message-association-standard-flat-index-metadata.util';
import { buildMessageParticipantStandardFlatIndexMetadatas } from 'src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-participant-standard-flat-index-metadata.util';
@@ -42,6 +45,9 @@ const STANDARD_FLAT_INDEX_METADATA_BUILDERS_BY_OBJECT_NAME = {
callRecording: buildCallRecordingStandardFlatIndexMetadatas,
company: buildCompanyStandardFlatIndexMetadatas,
dashboard: buildDashboardStandardFlatIndexMetadatas,
+ messageCampaign: buildMessageCampaignStandardFlatIndexMetadatas,
+ messageList: buildMessageListStandardFlatIndexMetadatas,
+ messageListMember: buildMessageListMemberStandardFlatIndexMetadatas,
message: buildMessageStandardFlatIndexMetadatas,
messageChannelMessageAssociation:
buildMessageChannelMessageAssociationStandardFlatIndexMetadatas,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-campaign-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-campaign-standard-flat-index-metadata.util.ts
new file mode 100644
index 00000000000..f7414e52bcf
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-campaign-standard-flat-index-metadata.util.ts
@@ -0,0 +1,57 @@
+import { type FlatIndexMetadata } from 'src/engine/metadata-modules/flat-index-metadata/types/flat-index-metadata.type';
+import { IndexType } from 'src/engine/metadata-modules/index-metadata/types/indexType.types';
+import { type AllStandardObjectIndexName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-index-name.type';
+import {
+ type CreateStandardIndexArgs,
+ createStandardIndexFlatMetadata,
+} from 'src/engine/workspace-manager/twenty-standard-application/utils/index/create-standard-index-flat-metadata.util';
+
+export const buildMessageCampaignStandardFlatIndexMetadatas = ({
+ now,
+ objectName,
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+}: Omit<CreateStandardIndexArgs<'messageCampaign'>, 'context'>): Record<
+ AllStandardObjectIndexName<'messageCampaign'>,
+ FlatIndexMetadata
+> => ({
+ unsubscribeTopicIdIndex: createStandardIndexFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ indexName: 'unsubscribeTopicIdIndex',
+ relatedFieldNames: ['unsubscribeTopicId'],
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ listIdIndex: createStandardIndexFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ indexName: 'listIdIndex',
+ relatedFieldNames: ['list'],
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ searchVectorGinIndex: createStandardIndexFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ indexName: 'searchVectorGinIndex',
+ relatedFieldNames: ['searchVector'],
+ indexType: IndexType.GIN,
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+});
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-list-member-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-list-member-standard-flat-index-metadata.util.ts
new file mode 100644
index 00000000000..ec6191a78f7
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-list-member-standard-flat-index-metadata.util.ts
@@ -0,0 +1,45 @@
+import { type FlatIndexMetadata } from 'src/engine/metadata-modules/flat-index-metadata/types/flat-index-metadata.type';
+import { type AllStandardObjectIndexName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-index-name.type';
+import {
+ type CreateStandardIndexArgs,
+ createStandardIndexFlatMetadata,
+} from 'src/engine/workspace-manager/twenty-standard-application/utils/index/create-standard-index-flat-metadata.util';
+
+export const buildMessageListMemberStandardFlatIndexMetadatas = ({
+ now,
+ objectName,
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+}: Omit<CreateStandardIndexArgs<'messageListMember'>, 'context'>): Record<
+ AllStandardObjectIndexName<'messageListMember'>,
+ FlatIndexMetadata
+> => ({
+ listIdIndex: createStandardIndexFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ indexName: 'listIdIndex',
+ relatedFieldNames: ['list'],
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+ personListUniqueIndex: createStandardIndexFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ indexName: 'personListUniqueIndex',
+ relatedFieldNames: ['person', 'list'],
+ isUnique: true,
+ indexWhereClause: '"deletedAt" IS NULL',
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+});
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-list-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-list-standard-flat-index-metadata.util.ts
new file mode 100644
index 00000000000..b7114db8d6d
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-list-standard-flat-index-metadata.util.ts
@@ -0,0 +1,33 @@
+import { type FlatIndexMetadata } from 'src/engine/metadata-modules/flat-index-metadata/types/flat-index-metadata.type';
+import { IndexType } from 'src/engine/metadata-modules/index-metadata/types/indexType.types';
+import { type AllStandardObjectIndexName } from 'src/engine/workspace-manager/twenty-standard-application/types/all-standard-object-index-name.type';
+import {
+ type CreateStandardIndexArgs,
+ createStandardIndexFlatMetadata,
+} from 'src/engine/workspace-manager/twenty-standard-application/utils/index/create-standard-index-flat-metadata.util';
+
+export const buildMessageListStandardFlatIndexMetadatas = ({
+ now,
+ objectName,
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+}: Omit<CreateStandardIndexArgs<'messageList'>, 'context'>): Record<
+ AllStandardObjectIndexName<'messageList'>,
+ FlatIndexMetadata
+> => ({
+ searchVectorGinIndex: createStandardIndexFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ indexName: 'searchVectorGinIndex',
+ relatedFieldNames: ['searchVector'],
+ indexType: IndexType.GIN,
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
+});
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-participant-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-participant-standard-flat-index-metadata.util.ts
index 7a53f40f473..040b80a7b7a 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-participant-standard-flat-index-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-participant-standard-flat-index-metadata.util.ts
@@ -52,4 +52,16 @@ export const buildMessageParticipantStandardFlatIndexMetadatas = ({
twentyStandardApplicationId,
now,
}),
+ messageCampaignIdIndex: createStandardIndexFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ indexName: 'messageCampaignIdIndex',
+ relatedFieldNames: ['messageCampaign'],
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
});
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-standard-flat-index-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-standard-flat-index-metadata.util.ts
index a5290e5ca19..0a3fc3f9efe 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-standard-flat-index-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/index/compute-message-standard-flat-index-metadata.util.ts
@@ -28,4 +28,16 @@ export const buildMessageStandardFlatIndexMetadatas = ({
twentyStandardApplicationId,
now,
}),
+ messageCampaignIdIndex: createStandardIndexFlatMetadata({
+ objectName,
+ workspaceId,
+ context: {
+ indexName: 'messageCampaignIdIndex',
+ relatedFieldNames: ['messageCampaign'],
+ },
+ standardObjectMetadataRelatedEntityIds,
+ dependencyFlatEntityMaps,
+ twentyStandardApplicationId,
+ now,
+ }),
});
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-flat-object-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-flat-object-metadata.util.ts
index fe1eecd9c22..9ea8e6e2fc1 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-flat-object-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-flat-object-metadata.util.ts
@@ -245,6 +245,96 @@ export const STANDARD_FLAT_OBJECT_METADATA_BUILDERS_BY_OBJECT_NAME = {
twentyStandardApplicationId,
now,
}),
+ messageCampaign: ({
+ now,
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ twentyStandardApplicationId,
+ dependencyFlatEntityMaps,
+ }: Omit<
+ CreateStandardObjectArgs<'messageCampaign'>,
+ 'context' | 'objectName'
+ >) =>
+ createStandardObjectFlatMetadata({
+ objectName: 'messageCampaign',
+ dependencyFlatEntityMaps,
+ context: {
+ universalIdentifier:
+ STANDARD_OBJECTS.messageCampaign.universalIdentifier,
+ nameSingular: 'messageCampaign',
+ namePlural: 'messageCampaigns',
+ labelSingular: i18nLabel(msg`Campaign`),
+ labelPlural: i18nLabel(msg`Campaigns`),
+ description: i18nLabel(
+ msg`A bulk email send to an audience, with delivery stats`,
+ ),
+ icon: 'IconSend',
+ isSystem: true,
+ isUICreatable: false,
+ labelIdentifierFieldMetadataName: 'subject',
+ },
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ twentyStandardApplicationId,
+ now,
+ }),
+ messageList: ({
+ now,
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ twentyStandardApplicationId,
+ dependencyFlatEntityMaps,
+ }: Omit<CreateStandardObjectArgs<'messageList'>, 'context' | 'objectName'>) =>
+ createStandardObjectFlatMetadata({
+ objectName: 'messageList',
+ dependencyFlatEntityMaps,
+ context: {
+ universalIdentifier: STANDARD_OBJECTS.messageList.universalIdentifier,
+ nameSingular: 'messageList',
+ namePlural: 'messageLists',
+ labelSingular: i18nLabel(msg`List`),
+ labelPlural: i18nLabel(msg`Lists`),
+ description: i18nLabel(msg`A hand-picked audience of people`),
+ icon: 'IconUsersGroup',
+ isSystem: true,
+ isSearchable: true,
+ labelIdentifierFieldMetadataName: 'name',
+ },
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ twentyStandardApplicationId,
+ now,
+ }),
+ messageListMember: ({
+ now,
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ twentyStandardApplicationId,
+ dependencyFlatEntityMaps,
+ }: Omit<
+ CreateStandardObjectArgs<'messageListMember'>,
+ 'context' | 'objectName'
+ >) =>
+ createStandardObjectFlatMetadata({
+ objectName: 'messageListMember',
+ dependencyFlatEntityMaps,
+ context: {
+ universalIdentifier:
+ STANDARD_OBJECTS.messageListMember.universalIdentifier,
+ nameSingular: 'messageListMember',
+ namePlural: 'messageListMembers',
+ labelSingular: i18nLabel(msg`List Member`),
+ labelPlural: i18nLabel(msg`List Members`),
+ description: i18nLabel(msg`A person's membership in a list`),
+ icon: 'IconUser',
+ isSystem: true,
+ labelIdentifierFieldMetadataName: 'id',
+ },
+ workspaceId,
+ standardObjectMetadataRelatedEntityIds,
+ twentyStandardApplicationId,
+ now,
+ }),
messageChannelMessageAssociation: ({
now,
workspaceId,
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/index.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/index.ts
index 3a8e5b3f3bd..4cc551008f5 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/index.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/index.ts
@@ -4,9 +4,11 @@ export { STANDARD_CALENDAR_EVENT_PARTICIPANT_PAGE_LAYOUT_CONFIG } from './standa
export { STANDARD_CALL_RECORDING_PAGE_LAYOUT_CONFIG } from './standard-call-recording-page-layout.config';
export { STANDARD_COMPANY_PAGE_LAYOUT_CONFIG } from './standard-company-page-layout.config';
export { STANDARD_DASHBOARD_PAGE_LAYOUT_CONFIG } from './standard-dashboard-page-layout.config';
+export { STANDARD_MESSAGE_CAMPAIGN_PAGE_LAYOUT_CONFIG } from './standard-message-campaign-page-layout.config';
export { STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_MESSAGE_FOLDER_PAGE_LAYOUT_CONFIG } from './standard-message-channel-message-association-message-folder-page-layout.config';
export { STANDARD_MESSAGE_CHANNEL_MESSAGE_ASSOCIATION_PAGE_LAYOUT_CONFIG } from './standard-message-channel-message-association-page-layout.config';
export { STANDARD_MESSAGE_PARTICIPANT_PAGE_LAYOUT_CONFIG } from './standard-message-participant-page-layout.config';
+export { STANDARD_MESSAGE_LIST_PAGE_LAYOUT_CONFIG } from './standard-message-list-page-layout.config';
export { STANDARD_MESSAGE_THREAD_PAGE_LAYOUT_CONFIG } from './standard-message-thread-page-layout.config';
export { STANDARD_NOTE_PAGE_LAYOUT_CONFIG } from './standard-note-page-layout.config';
export { STANDARD_OPPORTUNITY_PAGE_LAYOUT_CONFIG } from './standard-opportunity-page-layout.config';
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-campaign-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-campaign-page-layout.config.ts
new file mode 100644
index 00000000000..ac101162148
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-campaign-page-layout.config.ts
@@ -0,0 +1,80 @@
+import {
+ STANDARD_OBJECTS,
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,
+} from 'twenty-shared/metadata';
+
+import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
+import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
+import {
+ GRID_POSITIONS,
+ TAB_PROPS,
+ VERTICAL_LIST_LAYOUT_POSITIONS,
+ WIDGET_PROPS,
+} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
+import {
+ type StandardPageLayoutConfig,
+ type StandardPageLayoutTabConfig,
+} from 'src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-page-layout-config.type';
+
+const MESSAGE_CAMPAIGN_PAGE_TABS = {
+ home: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage.tabs
+ .home.universalIdentifier,
+ ...TAB_PROPS.home,
+ widgets: {
+ fields: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage
+ .tabs.home.widgets.fields.universalIdentifier,
+ ...WIDGET_PROPS.fields,
+ },
+ list: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage
+ .tabs.home.widgets.list.universalIdentifier,
+ title: 'List',
+ type: WidgetType.FIELD,
+ gridPosition: GRID_POSITIONS.FULL_WIDTH,
+ position: VERTICAL_LIST_LAYOUT_POSITIONS.THIRD,
+ fieldUniversalIdentifier:
+ STANDARD_OBJECTS.messageCampaign.fields.list.universalIdentifier,
+ },
+ recipients: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage
+ .tabs.home.widgets.recipients.universalIdentifier,
+ title: 'Recipients',
+ type: WidgetType.FIELD,
+ gridPosition: GRID_POSITIONS.FULL_WIDTH,
+ position: VERTICAL_LIST_LAYOUT_POSITIONS.FOURTH,
+ fieldUniversalIdentifier:
+ STANDARD_OBJECTS.messageCampaign.fields.recipients
+ .universalIdentifier,
+ },
+ messages: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage
+ .tabs.home.widgets.messages.universalIdentifier,
+ title: 'Sent Messages',
+ type: WidgetType.FIELD,
+ gridPosition: GRID_POSITIONS.FULL_WIDTH,
+ position: VERTICAL_LIST_LAYOUT_POSITIONS.FIFTH,
+ fieldUniversalIdentifier:
+ STANDARD_OBJECTS.messageCampaign.fields.messages.universalIdentifier,
+ },
+ },
+ },
+} as const satisfies Record<string, StandardPageLayoutTabConfig>;
+
+export const STANDARD_MESSAGE_CAMPAIGN_PAGE_LAYOUT_CONFIG = {
+ name: 'Default Campaign Layout',
+ type: PageLayoutType.RECORD_PAGE,
+ objectUniversalIdentifier:
+ STANDARD_OBJECTS.messageCampaign.universalIdentifier,
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageCampaignRecordPage
+ .universalIdentifier,
+ defaultTabUniversalIdentifier: null,
+ tabs: MESSAGE_CAMPAIGN_PAGE_TABS,
+} as const satisfies StandardPageLayoutConfig;
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-list-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-list-page-layout.config.ts
new file mode 100644
index 00000000000..7651c932911
--- /dev/null
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-message-list-page-layout.config.ts
@@ -0,0 +1,56 @@
+import {
+ STANDARD_OBJECTS,
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS,
+} from 'twenty-shared/metadata';
+
+import { WidgetType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-type.enum';
+import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
+import {
+ GRID_POSITIONS,
+ TAB_PROPS,
+ VERTICAL_LIST_LAYOUT_POSITIONS,
+ WIDGET_PROPS,
+} from 'src/engine/workspace-manager/twenty-standard-application/constants/standard-page-layout-tabs.template';
+import {
+ type StandardPageLayoutConfig,
+ type StandardPageLayoutTabConfig,
+} from 'src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-page-layout-config.type';
+
+const MESSAGE_LIST_PAGE_TABS = {
+ home: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageListRecordPage.tabs.home
+ .universalIdentifier,
+ ...TAB_PROPS.home,
+ widgets: {
+ fields: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageListRecordPage.tabs
+ .home.widgets.fields.universalIdentifier,
+ ...WIDGET_PROPS.fields,
+ },
+ members: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageListRecordPage.tabs
+ .home.widgets.members.universalIdentifier,
+ title: 'Members',
+ type: WidgetType.FIELD,
+ gridPosition: GRID_POSITIONS.FULL_WIDTH,
+ position: VERTICAL_LIST_LAYOUT_POSITIONS.SECOND,
+ fieldUniversalIdentifier:
+ STANDARD_OBJECTS.messageList.fields.members.universalIdentifier,
+ },
+ },
+ },
+} as const satisfies Record<string, StandardPageLayoutTabConfig>;
+
+export const STANDARD_MESSAGE_LIST_PAGE_LAYOUT_CONFIG = {
+ name: 'Default List Layout',
+ type: PageLayoutType.RECORD_PAGE,
+ objectUniversalIdentifier: STANDARD_OBJECTS.messageList.universalIdentifier,
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.messageListRecordPage
+ .universalIdentifier,
+ defaultTabUniversalIdentifier: null,
+ tabs: MESSAGE_LIST_PAGE_TABS,
+} as const satisfies StandardPageLayoutConfig;
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-person-page-layout.config.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-person-page-layout.config.ts
index c2358864675..7d7d3ddaaca 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-person-page-layout.config.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/page-layout-config/standard-person-page-layout.config.ts
@@ -52,6 +52,17 @@ const PERSON_PAGE_TABS = {
STANDARD_OBJECTS.person.fields.pointOfContactForOpportunities
.universalIdentifier,
},
+ listMemberships: {
+ universalIdentifier:
+ STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS.personRecordPage.tabs.home
+ .widgets.listMemberships.universalIdentifier,
+ title: 'Lists',
+ type: WidgetType.FIELD,
+ gridPosition: GRID_POSITIONS.FULL_WIDTH,
+ position: VERTICAL_LIST_LAYOUT_POSITIONS.FIFTH,
+ fieldUniversalIdentifier:
+ STANDARD_OBJECTS.person.fields.listMemberships.universalIdentifier,
+ },
},
},
timeline: {
diff --git a/packages/twenty-server/src/modules/blocklist/utils/is-email-blocklisted.util.ts b/packages/twenty-server/src/modules/blocklist/utils/is-email-blocklisted.util.ts
index 642df70acdf..c5983e6d5e6 100644
--- a/packages/twenty-server/src/modules/blocklist/utils/is-email-blocklisted.util.ts
+++ b/packages/twenty-server/src/modules/blocklist/utils/is-email-blocklisted.util.ts
@@ -1,3 +1,5 @@
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
+
export const isEmailBlocklisted = (
channelHandle: string[],
email: string | null | undefined,
@@ -7,11 +9,15 @@ export const isEmailBlocklisted = (
return false;
}
+ const domain = getDomainFromEmail(email);
+
return blocklist.some((item) => {
if (item.startsWith('@')) {
- const domain = email.split('@')[1];
+ const bareDomain = item.slice(1);
- return domain === item.slice(1) || domain.endsWith(`.${item.slice(1)}`);
+ return (
+ domain === bareDomain || (domain?.endsWith(`.${bareDomain}`) ?? false)
+ );
}
return email === item;
diff --git a/packages/twenty-server/src/modules/contact-creation-manager/utils/get-domain-name-from-handle.util.ts b/packages/twenty-server/src/modules/contact-creation-manager/utils/get-domain-name-from-handle.util.ts
index 22db0ad276c..b78d881682f 100644
--- a/packages/twenty-server/src/modules/contact-creation-manager/utils/get-domain-name-from-handle.util.ts
+++ b/packages/twenty-server/src/modules/contact-creation-manager/utils/get-domain-name-from-handle.util.ts
@@ -1,9 +1,10 @@
import psl from 'psl';
import { isParsedDomain } from 'src/modules/contact-creation-manager/types/is-psl-parsed-domain.type';
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
export const getDomainNameFromHandle = (handle: string): string => {
- const wholeDomain = handle?.split('@')?.[1] || '';
+ const wholeDomain = getDomainFromEmail(handle) ?? '';
const result = psl.parse(wholeDomain);
diff --git a/packages/twenty-server/src/modules/emailing/controllers/unsubscribe.controller.ts b/packages/twenty-server/src/modules/emailing/controllers/unsubscribe.controller.ts
new file mode 100644
index 00000000000..e83e8b0a0ba
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/controllers/unsubscribe.controller.ts
@@ -0,0 +1,158 @@
+import {
+ BadRequestException,
+ Body,
+ Controller,
+ Get,
+ Header,
+ HttpCode,
+ Post,
+ Query,
+ UseGuards,
+} from '@nestjs/common';
+
+import { isNonEmptyString } from '@sniptt/guards';
+
+import { UnsubscribeTokenService } from 'src/engine/core-modules/emailing-domain/services/unsubscribe-token.service';
+import { MessageSuppressionReason } from 'src/engine/core-modules/emailing-domain/types/message-suppression-reason.type';
+import { MessageSuppressionSource } from 'src/engine/core-modules/emailing-domain/types/message-suppression-source.type';
+import { type UnsubscribeTokenPayload } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-token-payload.type';
+import { buildUnsubscribePreferencesPage } from 'src/engine/core-modules/emailing-domain/utils/build-unsubscribe-preferences-page.util';
+import { buildUnsubscribeResultPage } from 'src/engine/core-modules/emailing-domain/utils/build-unsubscribe-result-page.util';
+import { NoPermissionGuard } from 'src/engine/guards/no-permission.guard';
+import { PublicEndpointGuard } from 'src/engine/guards/public-endpoint.guard';
+import { MessageSuppressionService } from 'src/modules/emailing/services/message-suppression.service';
+
+const UNSUBSCRIBE_TOKEN_FORMAT = /^[A-Za-z0-9_-]{1,1024}$/;
+
+const UPDATE_PREFERENCES_PATH = '/emailing/unsubscribe/preferences';
+const UNSUBSCRIBE_ALL_PATH = '/emailing/unsubscribe/all';
+
+const HTML_CONTENT_TYPE = 'text/html; charset=utf-8';
+
+const PREVIEW_RESULT_PAGE = buildUnsubscribeResultPage(
+ 'Preview',
+ 'This is a preview — no changes were saved.',
+);
+
+type UnsubscribeFormBody = {
+ t?: string;
+ unsubscribeTopicId?: string | string[];
+};
+
+@Controller('emailing/unsubscribe')
+@UseGuards(PublicEndpointGuard, NoPermissionGuard)
+export class UnsubscribeController {
+ constructor(
+ private readonly unsubscribeTokenService: UnsubscribeTokenService,
+ private readonly messageSuppressionService: MessageSuppressionService,
+ ) {}
+
+ @Post()
+ @HttpCode(200)
+ async handleOneClickUnsubscribe(@Query('t') token: string): Promise<void> {
+ const payload = this.verifyTokenOrThrow(token);
+
+ if (payload.preview === true) {
+ return;
+ }
+
+ await this.messageSuppressionService.suppress({
+ workspaceId: payload.workspaceId,
+ emailAddress: payload.emailAddress,
+ reason: MessageSuppressionReason.UNSUBSCRIBE,
+ source: MessageSuppressionSource.SYSTEM,
+ unsubscribeTopicId: payload.unsubscribeTopicId ?? null,
+ });
+ }
+
+ @Get()
+ @Header('Content-Type', HTML_CONTENT_TYPE)
+ async handlePreferencesPage(@Query('t') token: string): Promise<string> {
+ const payload = this.verifyTokenOrThrow(token);
+
+ const topics = await this.messageSuppressionService.getTopicOptOutState({
+ workspaceId: payload.workspaceId,
+ emailAddress: payload.emailAddress,
+ });
+
+ return buildUnsubscribePreferencesPage({
+ token,
+ topics,
+ updatePath: UPDATE_PREFERENCES_PATH,
+ unsubscribeAllPath: UNSUBSCRIBE_ALL_PATH,
+ });
+ }
+
+ @Post('preferences')
+ @Header('Content-Type', HTML_CONTENT_TYPE)
+ async handleUpdatePreferences(
+ @Body() body: UnsubscribeFormBody,
+ ): Promise<string> {
+ const payload = this.verifyTokenOrThrow(body.t);
+
+ if (payload.preview === true) {
+ return PREVIEW_RESULT_PAGE;
+ }
+
+ await this.messageSuppressionService.setTopicOptOuts({
+ workspaceId: payload.workspaceId,
+ emailAddress: payload.emailAddress,
+ keptTopicIds: this.normalizeTopicIds(body.unsubscribeTopicId),
+ });
+
+ return buildUnsubscribeResultPage(
+ 'Preferences updated',
+ 'Your email preferences have been saved.',
+ );
+ }
+
+ @Post('all')
+ @Header('Content-Type', HTML_CONTENT_TYPE)
+ async handleUnsubscribeAll(
+ @Body() body: UnsubscribeFormBody,
+ ): Promise<string> {
+ const payload = this.verifyTokenOrThrow(body.t);
+
+ if (payload.preview === true) {
+ return PREVIEW_RESULT_PAGE;
+ }
+
+ await this.messageSuppressionService.suppress({
+ workspaceId: payload.workspaceId,
+ emailAddress: payload.emailAddress,
+ reason: MessageSuppressionReason.UNSUBSCRIBE,
+ source: MessageSuppressionSource.SYSTEM,
+ });
+
+ return buildUnsubscribeResultPage(
+ 'You have been unsubscribed',
+ 'You will no longer receive marketing emails from this sender.',
+ );
+ }
+
+ private normalizeTopicIds(
+ unsubscribeTopicId: string | string[] | undefined,
+ ): string[] {
+ if (Array.isArray(unsubscribeTopicId)) {
+ return unsubscribeTopicId.filter(isNonEmptyString);
+ }
+
+ return isNonEmptyString(unsubscribeTopicId) ? [unsubscribeTopicId] : [];
+ }
+
+ private verifyTokenOrThrow(
+ token: string | undefined,
+ ): UnsubscribeTokenPayload {
+ if (!isNonEmptyString(token) || !UNSUBSCRIBE_TOKEN_FORMAT.test(token)) {
+ throw new BadRequestException('Malformed unsubscribe token');
+ }
+
+ const payload = this.unsubscribeTokenService.verify(token);
+
+ if (payload === null) {
+ throw new BadRequestException('Invalid unsubscribe token');
+ }
+
+ return payload;
+ }
+}
diff --git a/packages/twenty-server/src/modules/emailing/emailing.module.ts b/packages/twenty-server/src/modules/emailing/emailing.module.ts
new file mode 100644
index 00000000000..fa0681b353e
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/emailing.module.ts
@@ -0,0 +1,53 @@
+import { Module } from '@nestjs/common';
+import { TypeOrmModule } from '@nestjs/typeorm';
+
+import { EmailingDomainModule } from 'src/engine/core-modules/emailing-domain/emailing-domain.module';
+import { EmailingDomainEntity } from 'src/engine/core-modules/emailing-domain/emailing-domain.entity';
+import { MessageSuppressionEntity } from 'src/engine/core-modules/emailing-domain/message-suppression.entity';
+import { UnsubscribeTopicEntity } from 'src/engine/core-modules/emailing-domain/unsubscribe-topic.entity';
+import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
+import { MessageChannelEntity } from 'src/engine/metadata-modules/message-channel/entities/message-channel.entity';
+import { MessageChannelMetadataModule } from 'src/engine/metadata-modules/message-channel/message-channel-metadata.module';
+import { PermissionsModule } from 'src/engine/metadata-modules/permissions/permissions.module';
+import { provideWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/provide-workspace-scoped-repository';
+import { UnsubscribeController } from 'src/modules/emailing/controllers/unsubscribe.controller';
+import { EmailingSendResolver } from 'src/modules/emailing/resolvers/emailing-send.resolver';
+import { UnsubscribeTopicResolver } from 'src/modules/emailing/resolvers/unsubscribe-topic.resolver';
+import { EmailingDomainSenderService } from 'src/modules/emailing/services/emailing-domain-sender.service';
+import { MessageCampaignService } from 'src/modules/emailing/services/message-campaign.service';
+import { MessageSuppressionService } from 'src/modules/emailing/services/message-suppression.service';
+import { UnsubscribeTopicService } from 'src/modules/emailing/services/unsubscribe-topic.service';
+
+@Module({
+ imports: [
+ EmailingDomainModule,
+ MessageChannelMetadataModule,
+ FeatureFlagModule,
+ PermissionsModule,
+ TypeOrmModule.forFeature([
+ MessageChannelEntity,
+ EmailingDomainEntity,
+ MessageSuppressionEntity,
+ UnsubscribeTopicEntity,
+ ]),
+ ],
+ controllers: [UnsubscribeController],
+ providers: [
+ MessageCampaignService,
+ MessageSuppressionService,
+ UnsubscribeTopicService,
+ EmailingDomainSenderService,
+ EmailingSendResolver,
+ UnsubscribeTopicResolver,
+ provideWorkspaceScopedRepository(EmailingDomainEntity),
+ provideWorkspaceScopedRepository(MessageSuppressionEntity),
+ provideWorkspaceScopedRepository(UnsubscribeTopicEntity),
+ ],
+ exports: [
+ EmailingDomainSenderService,
+ MessageCampaignService,
+ MessageSuppressionService,
+ UnsubscribeTopicService,
+ ],
+})
+export class EmailingModule {}
diff --git a/packages/twenty-server/src/modules/emailing/jobs/materialize-campaign.job.ts b/packages/twenty-server/src/modules/emailing/jobs/materialize-campaign.job.ts
new file mode 100644
index 00000000000..4876a99ec0b
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/jobs/materialize-campaign.job.ts
@@ -0,0 +1,18 @@
+import { MATERIALIZE_CAMPAIGN_JOB } from 'src/engine/core-modules/emailing-domain/constants/campaign.constant';
+import { type MaterializeCampaignJobData } from 'src/engine/core-modules/emailing-domain/types/materialize-campaign-job-data.type';
+import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
+import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
+import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
+import { MessageCampaignService } from 'src/modules/emailing/services/message-campaign.service';
+
+@Processor(MessageQueue.emailQueue)
+export class MaterializeCampaignJob {
+ constructor(
+ private readonly messageCampaignService: MessageCampaignService,
+ ) {}
+
+ @Process(MATERIALIZE_CAMPAIGN_JOB)
+ async handle(data: MaterializeCampaignJobData): Promise<void> {
+ await this.messageCampaignService.processMaterializeJob(data);
+ }
+}
diff --git a/packages/twenty-server/src/modules/emailing/jobs/send-campaign-email.job.ts b/packages/twenty-server/src/modules/emailing/jobs/send-campaign-email.job.ts
new file mode 100644
index 00000000000..3f3a51c52d2
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/jobs/send-campaign-email.job.ts
@@ -0,0 +1,18 @@
+import { SEND_CAMPAIGN_EMAIL_JOB } from 'src/engine/core-modules/emailing-domain/constants/campaign.constant';
+import { MessageCampaignService } from 'src/modules/emailing/services/message-campaign.service';
+import { type SendCampaignEmailJobData } from 'src/engine/core-modules/emailing-domain/types/send-campaign-email-job-data.type';
+import { Process } from 'src/engine/core-modules/message-queue/decorators/process.decorator';
+import { Processor } from 'src/engine/core-modules/message-queue/decorators/processor.decorator';
+import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
+
+@Processor(MessageQueue.emailQueue)
+export class SendCampaignEmailJob {
+ constructor(
+ private readonly messageCampaignService: MessageCampaignService,
+ ) {}
+
+ @Process(SEND_CAMPAIGN_EMAIL_JOB)
+ async handle(data: SendCampaignEmailJobData): Promise<void> {
+ await this.messageCampaignService.processSendJob(data);
+ }
+}
diff --git a/packages/twenty-server/src/modules/emailing/resolvers/emailing-send.resolver.ts b/packages/twenty-server/src/modules/emailing/resolvers/emailing-send.resolver.ts
new file mode 100644
index 00000000000..2cc7672031c
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/resolvers/emailing-send.resolver.ts
@@ -0,0 +1,86 @@
+import { UseGuards, UsePipes } from '@nestjs/common';
+import { Args, Mutation, Query } from '@nestjs/graphql';
+
+import { PermissionFlagType } from 'twenty-shared/constants';
+import { FeatureFlagKey } from 'twenty-shared/types';
+
+import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
+import { CampaignAudiencePreviewDTO } from 'src/engine/core-modules/emailing-domain/dtos/campaign-audience-preview.dto';
+import { PreviewMessageCampaignAudienceInput } from 'src/engine/core-modules/emailing-domain/dtos/preview-message-campaign-audience.input';
+import { SendEmailViaDomainInput } from 'src/engine/core-modules/emailing-domain/dtos/send-email-via-domain.input';
+import { SendEmailViaDomainOutputDTO } from 'src/engine/core-modules/emailing-domain/dtos/send-email-via-domain-output.dto';
+import { SendMessageCampaignInput } from 'src/engine/core-modules/emailing-domain/dtos/send-message-campaign.input';
+import { SendMessageCampaignOutputDTO } from 'src/engine/core-modules/emailing-domain/dtos/send-message-campaign-output.dto';
+import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
+import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
+import { AuthUserWorkspaceId } from 'src/engine/decorators/auth/auth-user-workspace-id.decorator';
+import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
+import {
+ FeatureFlagGuard,
+ RequireFeatureFlag,
+} from 'src/engine/guards/feature-flag.guard';
+import { SettingsPermissionGuard } from 'src/engine/guards/settings-permission.guard';
+import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
+import { EmailingDomainSenderService } from 'src/modules/emailing/services/emailing-domain-sender.service';
+import { MessageCampaignService } from 'src/modules/emailing/services/message-campaign.service';
+
+@UseGuards(
+ WorkspaceAuthGuard,
+ FeatureFlagGuard,
+ SettingsPermissionGuard(PermissionFlagType.WORKSPACE),
+)
+@UsePipes(ResolverValidationPipe)
+@MetadataResolver()
+export class EmailingSendResolver {
+ constructor(
+ private readonly emailingDomainSenderService: EmailingDomainSenderService,
+ private readonly messageCampaignService: MessageCampaignService,
+ ) {}
+
+ @Mutation(() => SendEmailViaDomainOutputDTO)
+ @RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
+ async sendEmailViaEmailingDomain(
+ @Args('input') input: SendEmailViaDomainInput,
+ @AuthWorkspace() currentWorkspace: WorkspaceEntity,
+ ): Promise<SendEmailViaDomainOutputDTO> {
+ const { emailingDomainId, ...content } = input;
+ const result = await this.emailingDomainSenderService.sendEmail(
+ currentWorkspace.id,
+ emailingDomainId,
+ content,
+ );
+
+ return { messageId: result.messageId };
+ }
+
+ @Mutation(() => SendMessageCampaignOutputDTO)
+ @RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
+ async sendMessageCampaign(
+ @Args('input') input: SendMessageCampaignInput,
+ @AuthWorkspace() currentWorkspace: WorkspaceEntity,
+ @AuthUserWorkspaceId() userWorkspaceId: string,
+ ): Promise<SendMessageCampaignOutputDTO> {
+ return this.messageCampaignService.send({
+ workspaceId: currentWorkspace.id,
+ userWorkspaceId,
+ unsubscribeTopicId: input.unsubscribeTopicId,
+ listId: input.listId,
+ subject: input.subject,
+ html: input.body,
+ fromAddress: input.fromAddress,
+ });
+ }
+
+ @Query(() => CampaignAudiencePreviewDTO)
+ @RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
+ async previewMessageCampaignAudience(
+ @Args('input') input: PreviewMessageCampaignAudienceInput,
+ @AuthWorkspace() currentWorkspace: WorkspaceEntity,
+ ): Promise<CampaignAudiencePreviewDTO> {
+ return this.messageCampaignService.previewAudience({
+ workspaceId: currentWorkspace.id,
+ listId: input.listId,
+ unsubscribeTopicId: input.unsubscribeTopicId,
+ });
+ }
+}
diff --git a/packages/twenty-server/src/modules/emailing/resolvers/unsubscribe-topic.resolver.ts b/packages/twenty-server/src/modules/emailing/resolvers/unsubscribe-topic.resolver.ts
new file mode 100644
index 00000000000..50c2a0724ec
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/resolvers/unsubscribe-topic.resolver.ts
@@ -0,0 +1,101 @@
+import { UseGuards, UsePipes } from '@nestjs/common';
+import { Args, Mutation, Query } from '@nestjs/graphql';
+
+import { PermissionFlagType } from 'twenty-shared/constants';
+import { FeatureFlagKey } from 'twenty-shared/types';
+
+import { MetadataResolver } from 'src/engine/api/graphql/graphql-config/decorators/metadata-resolver.decorator';
+import { CreateUnsubscribeTopicInput } from 'src/engine/core-modules/emailing-domain/dtos/create-unsubscribe-topic.input';
+import { UnsubscribeTopicDTO } from 'src/engine/core-modules/emailing-domain/dtos/unsubscribe-topic.dto';
+import { UpdateUnsubscribeTopicInput } from 'src/engine/core-modules/emailing-domain/dtos/update-unsubscribe-topic.input';
+import { UnsubscribeTokenService } from 'src/engine/core-modules/emailing-domain/services/unsubscribe-token.service';
+import { ResolverValidationPipe } from 'src/engine/core-modules/graphql/pipes/resolver-validation.pipe';
+import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
+import { WorkspaceEntity } from 'src/engine/core-modules/workspace/workspace.entity';
+import { AuthWorkspace } from 'src/engine/decorators/auth/auth-workspace.decorator';
+import {
+ FeatureFlagGuard,
+ RequireFeatureFlag,
+} from 'src/engine/guards/feature-flag.guard';
+import { SettingsPermissionGuard } from 'src/engine/guards/settings-permission.guard';
+import { WorkspaceAuthGuard } from 'src/engine/guards/workspace-auth.guard';
+import { UnsubscribeTopicService } from 'src/modules/emailing/services/unsubscribe-topic.service';
+
+const UNSUBSCRIBE_PREVIEW_PLACEHOLDER_EMAIL = '[email protected]';
+
+@UseGuards(
+ WorkspaceAuthGuard,
+ FeatureFlagGuard,
+ SettingsPermissionGuard(PermissionFlagType.WORKSPACE),
+)
+@UsePipes(ResolverValidationPipe)
+@MetadataResolver(() => UnsubscribeTopicDTO)
+export class UnsubscribeTopicResolver {
+ constructor(
+ private readonly unsubscribeTopicService: UnsubscribeTopicService,
+ private readonly unsubscribeTokenService: UnsubscribeTokenService,
+ private readonly twentyConfigService: TwentyConfigService,
+ ) {}
+
+ @Query(() => [UnsubscribeTopicDTO])
+ @RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
+ async unsubscribeTopics(
+ @AuthWorkspace() currentWorkspace: WorkspaceEntity,
+ ): Promise<UnsubscribeTopicDTO[]> {
+ return this.unsubscribeTopicService.getUnsubscribeTopics(
+ currentWorkspace.id,
+ );
+ }
+
+ @Query(() => String)
+ @RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
+ unsubscribePagePreviewUrl(
+ @AuthWorkspace() currentWorkspace: WorkspaceEntity,
+ ): string {
+ const token = this.unsubscribeTokenService.sign({
+ workspaceId: currentWorkspace.id,
+ emailAddress: UNSUBSCRIBE_PREVIEW_PLACEHOLDER_EMAIL,
+ preview: true,
+ });
+
+ return `${this.twentyConfigService.get('SERVER_URL')}/emailing/unsubscribe?t=${token}`;
+ }
+
+ @Mutation(() => UnsubscribeTopicDTO)
+ @RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
+ async createUnsubscribeTopic(
+ @Args('input') input: CreateUnsubscribeTopicInput,
+ @AuthWorkspace() currentWorkspace: WorkspaceEntity,
+ ): Promise<UnsubscribeTopicDTO> {
+ return this.unsubscribeTopicService.createUnsubscribeTopic(
+ currentWorkspace.id,
+ input,
+ );
+ }
+
+ @Mutation(() => UnsubscribeTopicDTO)
+ @RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
+ async updateUnsubscribeTopic(
+ @Args('input') input: UpdateUnsubscribeTopicInput,
+ @AuthWorkspace() currentWorkspace: WorkspaceEntity,
+ ): Promise<UnsubscribeTopicDTO> {
+ return this.unsubscribeTopicService.updateUnsubscribeTopic(
+ currentWorkspace.id,
+ input,
+ );
+ }
+
+ @Mutation(() => Boolean)
+ @RequireFeatureFlag(FeatureFlagKey.IS_EMAIL_GROUP_ENABLED)
+ async deleteUnsubscribeTopic(
+ @Args('id') id: string,
+ @AuthWorkspace() currentWorkspace: WorkspaceEntity,
+ ): Promise<boolean> {
+ await this.unsubscribeTopicService.deleteUnsubscribeTopic(
+ currentWorkspace.id,
+ id,
+ );
+
+ return true;
+ }
+}
diff --git a/packages/twenty-server/src/modules/emailing/services/emailing-domain-sender.service.ts b/packages/twenty-server/src/modules/emailing/services/emailing-domain-sender.service.ts
new file mode 100644
index 00000000000..6e00ad7c8b2
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/services/emailing-domain-sender.service.ts
@@ -0,0 +1,277 @@
+import { Injectable } from '@nestjs/common';
+import { InjectRepository } from '@nestjs/typeorm';
+
+import { isNonEmptyString } from '@sniptt/guards';
+import { MessageChannelType } from 'twenty-shared/types';
+import { Repository } from 'typeorm';
+
+import { EMPTY_UNSUBSCRIBE_CONTENT } from 'src/engine/core-modules/emailing-domain/constants/empty-unsubscribe-content.constant';
+import {
+ EmailingDomainDriverException,
+ EmailingDomainDriverExceptionCode,
+} from 'src/engine/core-modules/emailing-domain/drivers/exceptions/emailing-domain-driver.exception';
+import { EmailingDomainDriverFactory } from 'src/engine/core-modules/emailing-domain/drivers/emailing-domain-driver.factory';
+import { EmailingDomainStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-status.type';
+import { EmailingDomainTenantStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-tenant-status.type';
+import { type EmailingDomainEmailContent } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-email-content.type';
+import { type EmailingDomainSendEmailInput } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-input.type';
+import { type EmailingDomainSendEmailResult } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-result.type';
+import { UnsubscribeHostnameStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/unsubscribe-hostname-status.type';
+import { EmailingDomainDriver } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-driver.type';
+import { EmailingDomainEntity } from 'src/engine/core-modules/emailing-domain/emailing-domain.entity';
+import { MessageSuppressionService } from 'src/modules/emailing/services/message-suppression.service';
+import { UnsubscribeTokenService } from 'src/engine/core-modules/emailing-domain/services/unsubscribe-token.service';
+import { MessageChannelEntity } from 'src/engine/metadata-modules/message-channel/entities/message-channel.entity';
+import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
+import { type DeliverableRecipients } from 'src/engine/core-modules/emailing-domain/types/deliverable-recipients.type';
+import { type UnsubscribeContent } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-content.type';
+import { buildUnsubscribeHeaders } from 'src/engine/core-modules/emailing-domain/utils/build-unsubscribe-headers.util';
+import { buildUnsubscribeHtmlFooter } from 'src/engine/core-modules/emailing-domain/utils/build-unsubscribe-html-footer.util';
+import { buildUnsubscribeTextFooter } from 'src/engine/core-modules/emailing-domain/utils/build-unsubscribe-text-footer.util';
+import { buildUnsubscribeUrls } from 'src/engine/core-modules/emailing-domain/utils/build-unsubscribe-urls.util';
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
+import { InjectWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/inject-workspace-scoped-repository.decorator';
+import { WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/workspace-scoped-repository';
+import { isDefined } from 'twenty-shared/utils';
+
+@Injectable()
+export class EmailingDomainSenderService {
+ constructor(
+ @InjectWorkspaceScopedRepository(EmailingDomainEntity)
+ private readonly emailingDomainRepository: WorkspaceScopedRepository<EmailingDomainEntity>,
+ private readonly emailingDomainDriverFactory: EmailingDomainDriverFactory,
+ private readonly messageSuppressionService: MessageSuppressionService,
+ private readonly unsubscribeTokenService: UnsubscribeTokenService,
+ private readonly twentyConfigService: TwentyConfigService,
+ @InjectRepository(MessageChannelEntity)
+ private readonly messageChannelRepository: Repository<MessageChannelEntity>,
+ ) {}
+
+ async sendEmail(
+ workspaceId: string,
+ emailingDomainId: string,
+ emailContent: EmailingDomainEmailContent,
+ ): Promise<EmailingDomainSendEmailResult> {
+ const emailingDomain = await this.findEmailingDomainByIdOrThrow(
+ workspaceId,
+ emailingDomainId,
+ );
+
+ this.assertDomainCanSend(emailingDomain, emailContent.from);
+
+ const recipients = await this.selectDeliverableRecipients(
+ workspaceId,
+ emailingDomain,
+ emailContent,
+ );
+
+ const unsubscribe = this.buildUnsubscribeContent(
+ workspaceId,
+ emailingDomain,
+ recipients.to[0],
+ emailContent.unsubscribeTopicId,
+ );
+
+ const replyTo = await this.resolveReplyTo(workspaceId, emailContent);
+
+ const emailToSend = {
+ workspaceId,
+ domain: emailingDomain.domain,
+ from: emailContent.from,
+ replyTo,
+ to: recipients.to,
+ cc: recipients.cc,
+ bcc: recipients.bcc,
+ subject: emailContent.subject,
+ text: `${emailContent.text}${unsubscribe.textFooter}`,
+ html: isNonEmptyString(emailContent.html)
+ ? `${emailContent.html}${unsubscribe.htmlFooter}`
+ : emailContent.html,
+ attachments: emailContent.attachments,
+ headers: [...(emailContent.headers ?? []), ...unsubscribe.headers],
+ } as EmailingDomainSendEmailInput;
+
+ return this.emailingDomainDriverFactory
+ .getCurrentDriver()
+ .sendEmail(emailToSend);
+ }
+
+ private async resolveReplyTo(
+ workspaceId: string,
+ emailContent: EmailingDomainEmailContent,
+ ): Promise<string[] | undefined> {
+ if (isDefined(emailContent.replyTo) && emailContent.replyTo.length > 0) {
+ return emailContent.replyTo;
+ }
+
+ const emailGroupChannel = await this.messageChannelRepository.findOne({
+ where: {
+ workspaceId,
+ type: MessageChannelType.EMAIL_GROUP,
+ connectedAccount: { handle: emailContent.from },
+ },
+ relations: { connectedAccount: true },
+ });
+
+ const forwardingAddress = emailGroupChannel?.handle;
+
+ return isNonEmptyString(forwardingAddress)
+ ? [forwardingAddress]
+ : undefined;
+ }
+
+ private async findEmailingDomainByIdOrThrow(
+ workspaceId: string,
+ emailingDomainId: string,
+ ): Promise<EmailingDomainEntity> {
+ const emailingDomain = await this.emailingDomainRepository.findOne(
+ workspaceId,
+ { where: { id: emailingDomainId } },
+ );
+
+ if (!isDefined(emailingDomain)) {
+ throw new EmailingDomainDriverException(
+ 'Emailing domain not found',
+ EmailingDomainDriverExceptionCode.NOT_FOUND,
+ );
+ }
+
+ return emailingDomain;
+ }
+
+ private assertDomainCanSend(
+ emailingDomain: EmailingDomainEntity,
+ fromAddress: string,
+ ): void {
+ if (emailingDomain.status !== EmailingDomainStatus.VERIFIED) {
+ throw new EmailingDomainDriverException(
+ `Emailing domain is not verified (status: ${emailingDomain.status})`,
+ EmailingDomainDriverExceptionCode.CONFIGURATION_ERROR,
+ );
+ }
+
+ if (emailingDomain.tenantStatus !== EmailingDomainTenantStatus.ACTIVE) {
+ throw new EmailingDomainDriverException(
+ `Sending is suspended for emailing domain ${emailingDomain.domain} (tenantStatus: ${emailingDomain.tenantStatus})`,
+ EmailingDomainDriverExceptionCode.SENDING_SUSPENDED,
+ );
+ }
+
+ const fromAddressDomain = getDomainFromEmail(fromAddress)?.toLowerCase();
+
+ if (fromAddressDomain !== emailingDomain.domain.toLowerCase()) {
+ throw new EmailingDomainDriverException(
+ `From address ${fromAddress} does not match verified domain ${emailingDomain.domain}`,
+ EmailingDomainDriverExceptionCode.CONFIGURATION_ERROR,
+ );
+ }
+ }
+
+ private async selectDeliverableRecipients(
+ workspaceId: string,
+ emailingDomain: EmailingDomainEntity,
+ emailContent: EmailingDomainEmailContent,
+ ): Promise<DeliverableRecipients> {
+ const allRecipients = [
+ ...emailContent.to,
+ ...(emailContent.cc ?? []),
+ ...(emailContent.bcc ?? []),
+ ];
+
+ const suppressedAddresses =
+ await this.messageSuppressionService.getSuppressedAddresses(
+ workspaceId,
+ allRecipients,
+ );
+
+ const listUnsubscribedAddresses = await this.getListUnsubscribedAddresses(
+ workspaceId,
+ allRecipients,
+ emailContent.unsubscribeTopicId,
+ );
+
+ const isDeliverable = (address: string): boolean => {
+ const normalizedAddress = address.trim().toLowerCase();
+
+ return (
+ !suppressedAddresses.has(normalizedAddress) &&
+ !listUnsubscribedAddresses.has(normalizedAddress)
+ );
+ };
+
+ const to = emailContent.to.filter(isDeliverable);
+
+ if (to.length === 0) {
+ throw new EmailingDomainDriverException(
+ `All primary recipients are suppressed for emailing domain ${emailingDomain.domain}`,
+ EmailingDomainDriverExceptionCode.ALL_RECIPIENTS_SUPPRESSED,
+ );
+ }
+
+ return {
+ to,
+ cc: emailContent.cc?.filter(isDeliverable),
+ bcc: emailContent.bcc?.filter(isDeliverable),
+ };
+ }
+
+ private async getListUnsubscribedAddresses(
+ workspaceId: string,
+ recipients: string[],
+ unsubscribeTopicId: string | undefined,
+ ): Promise<Set<string>> {
+ if (!isNonEmptyString(unsubscribeTopicId)) {
+ return new Set();
+ }
+
+ return this.messageSuppressionService.getTopicSuppressedAddresses(
+ workspaceId,
+ recipients,
+ unsubscribeTopicId,
+ );
+ }
+
+ private buildUnsubscribeContent(
+ workspaceId: string,
+ emailingDomain: EmailingDomainEntity,
+ primaryRecipient: string,
+ unsubscribeTopicId: string | undefined,
+ ): UnsubscribeContent {
+ const isDemoMode =
+ this.twentyConfigService.get('EMAILING_DOMAIN_DRIVER') ===
+ EmailingDomainDriver.LOG;
+
+ if (isDemoMode) {
+ return EMPTY_UNSUBSCRIBE_CONTENT;
+ }
+
+ if (
+ emailingDomain.unsubscribeHostnameStatus !==
+ UnsubscribeHostnameStatus.ACTIVE ||
+ !isNonEmptyString(emailingDomain.unsubscribeHostname)
+ ) {
+ throw new EmailingDomainDriverException(
+ `Cannot send email for ${emailingDomain.domain}: unsubscribe domain is not active (status: ${emailingDomain.unsubscribeHostnameStatus})`,
+ EmailingDomainDriverExceptionCode.UNSUBSCRIBE_NOT_READY,
+ );
+ }
+
+ const token = this.unsubscribeTokenService.sign({
+ workspaceId,
+ emailAddress: primaryRecipient,
+ ...(isNonEmptyString(unsubscribeTopicId) ? { unsubscribeTopicId } : {}),
+ });
+
+ const unsubscribeUrls = buildUnsubscribeUrls({
+ unsubscribeHostname: emailingDomain.unsubscribeHostname,
+ domain: emailingDomain.domain,
+ token,
+ });
+
+ return {
+ headers: buildUnsubscribeHeaders(unsubscribeUrls),
+ textFooter: buildUnsubscribeTextFooter(unsubscribeUrls.httpsUrl),
+ htmlFooter: buildUnsubscribeHtmlFooter(unsubscribeUrls.httpsUrl),
+ };
+ }
+}
diff --git a/packages/twenty-server/src/modules/emailing/services/message-campaign.service.ts b/packages/twenty-server/src/modules/emailing/services/message-campaign.service.ts
new file mode 100644
index 00000000000..f3b810566f4
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/services/message-campaign.service.ts
@@ -0,0 +1,762 @@
+import { Injectable, Logger, type Type } from '@nestjs/common';
+
+import { isNonEmptyString } from '@sniptt/guards';
+import { In, type ObjectLiteral } from 'typeorm';
+import { v4, v5 } from 'uuid';
+
+import {
+ CAMPAIGN_MESSAGE_DELIVERY_STATUS,
+ CAMPAIGN_MESSAGE_ID_NAMESPACE,
+ CAMPAIGN_STATUS,
+ MATERIALIZE_CAMPAIGN_JOB,
+ MAX_CAMPAIGN_RECIPIENTS,
+ SEND_CAMPAIGN_EMAIL_JOB,
+} from 'src/engine/core-modules/emailing-domain/constants/campaign.constant';
+import {
+ EmailingDomainDriverException,
+ EmailingDomainDriverExceptionCode,
+} from 'src/engine/core-modules/emailing-domain/drivers/exceptions/emailing-domain-driver.exception';
+import { EmailingDomainStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-status.type';
+import { type EmailingDomainSendEmailResult } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-send-email-result.type';
+import { EmailingDomainEntity } from 'src/engine/core-modules/emailing-domain/emailing-domain.entity';
+import { type CampaignRecipient } from 'src/engine/core-modules/emailing-domain/types/campaign-recipient.type';
+import { type CampaignSkippedBreakdown } from 'src/engine/core-modules/emailing-domain/types/campaign-skipped-breakdown.type';
+import { type MaterializeCampaignJobData } from 'src/engine/core-modules/emailing-domain/types/materialize-campaign-job-data.type';
+import { type RawCampaignRecipient } from 'src/engine/core-modules/emailing-domain/types/raw-campaign-recipient.type';
+import { type SendCampaignEmailJobData } from 'src/engine/core-modules/emailing-domain/types/send-campaign-email-job-data.type';
+import { normalizeCampaignRecipients } from 'src/engine/core-modules/emailing-domain/utils/normalize-campaign-recipients.util';
+import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
+import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
+import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
+import { MessageChannelMetadataService } from 'src/engine/metadata-modules/message-channel/message-channel-metadata.service';
+import { type WorkspaceEntityManager } from 'src/engine/twenty-orm/entity-manager/workspace-entity-manager';
+import { GlobalWorkspaceOrmManager } from 'src/engine/twenty-orm/global-workspace-datasource/global-workspace-orm.manager';
+import { buildSystemAuthContext } from 'src/engine/twenty-orm/utils/build-system-auth-context.util';
+import { InjectWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/inject-workspace-scoped-repository.decorator';
+import { WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/workspace-scoped-repository';
+import { EmailingDomainSenderService } from 'src/modules/emailing/services/emailing-domain-sender.service';
+import { MessageSuppressionService } from 'src/modules/emailing/services/message-suppression.service';
+import { MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
+import { MessageListMemberWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-list-member.workspace-entity';
+import { renderCampaignTemplate } from 'src/modules/emailing/utils/render-campaign-template.util';
+import { MessageDirection } from 'src/modules/messaging/common/enums/message-direction.enum';
+import { MessageChannelMessageAssociationWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity';
+import { MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
+import { MessageThreadWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-thread.workspace-entity';
+import { MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
+import { createHtmlToTextConverter } from 'src/modules/messaging/message-import-manager/utils/create-html-to-text-converter.util';
+import { PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
+import { MessageParticipantRole } from 'twenty-shared/types';
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
+
+type SendCampaignArgs = {
+ workspaceId: string;
+ userWorkspaceId: string;
+ listId: string;
+ subject: string;
+ html: string;
+ fromAddress: string;
+ unsubscribeTopicId?: string;
+};
+
+type SendCampaignResult = {
+ campaignId: string;
+ queuedCount: number;
+ skipped: CampaignSkippedBreakdown;
+};
+
+type CampaignAudiencePreview = {
+ totalMembers: number;
+ withoutEmail: number;
+ duplicateEmails: number;
+ globallyUnsubscribed: number;
+ topicUnsubscribed: number;
+ sendable: number;
+};
+
+type CampaignMessageRecipient = CampaignRecipient & { messageId: string };
+
+const toRawRecipient = (person: {
+ id: string;
+ emails?: { primaryEmail?: string | null } | null;
+}): RawCampaignRecipient => ({
+ personId: person.id,
+ email: person.emails?.primaryEmail ?? null,
+});
+
+@Injectable()
+export class MessageCampaignService {
+ private readonly logger = new Logger(MessageCampaignService.name);
+ private readonly htmlToText = createHtmlToTextConverter();
+
+ constructor(
+ @InjectWorkspaceScopedRepository(EmailingDomainEntity)
+ private readonly emailingDomainRepository: WorkspaceScopedRepository<EmailingDomainEntity>,
+ private readonly emailingDomainSenderService: EmailingDomainSenderService,
+ private readonly globalWorkspaceOrmManager: GlobalWorkspaceOrmManager,
+ @InjectMessageQueue(MessageQueue.emailQueue)
+ private readonly messageQueueService: MessageQueueService,
+ private readonly messageChannelMetadataService: MessageChannelMetadataService,
+ private readonly messageSuppressionService: MessageSuppressionService,
+ ) {}
+
+ private getUserRepository<T extends ObjectLiteral>(
+ workspaceId: string,
+ entity: Type<T>,
+ ) {
+ return this.globalWorkspaceOrmManager.getRepository(workspaceId, entity);
+ }
+
+ private getSystemRepository<T extends ObjectLiteral>(
+ workspaceId: string,
+ entity: Type<T>,
+ ) {
+ return this.globalWorkspaceOrmManager.getRepository(workspaceId, entity, {
+ shouldBypassPermissionChecks: true,
+ });
+ }
+
+ async send({
+ workspaceId,
+ userWorkspaceId,
+ unsubscribeTopicId,
+ subject,
+ html,
+ fromAddress,
+ listId,
+ }: SendCampaignArgs): Promise<SendCampaignResult> {
+ const fromDomain = getDomainFromEmail(fromAddress)?.toLowerCase();
+
+ const emailingDomain = await this.emailingDomainRepository.findOne(
+ workspaceId,
+ { where: { domain: fromDomain, status: EmailingDomainStatus.VERIFIED } },
+ );
+
+ if (emailingDomain === null) {
+ throw new Error(
+ `No verified emailing domain matches the from address ${fromAddress}`,
+ );
+ }
+
+ const { campaignId, recipients, skipped } =
+ await this.globalWorkspaceOrmManager.executeInWorkspaceContext(
+ async () => {
+ const rawRecipients = await this.resolveRecipientsFromList(
+ workspaceId,
+ listId,
+ );
+
+ const normalized = normalizeCampaignRecipients(
+ rawRecipients,
+ MAX_CAMPAIGN_RECIPIENTS,
+ );
+
+ const newCampaignId = await this.createCampaign({
+ workspaceId,
+ subject,
+ html,
+ fromAddress,
+ unsubscribeTopicId,
+ listId,
+ });
+
+ return {
+ campaignId: newCampaignId,
+ recipients: normalized.recipients,
+ skipped: normalized.skipped,
+ };
+ },
+ );
+
+ const messageChannel =
+ await this.messageChannelMetadataService.getOrCreateEmailGroupChannel({
+ fromAddress,
+ userWorkspaceId,
+ workspaceId,
+ });
+
+ await this.messageQueueService.add<MaterializeCampaignJobData>(
+ MATERIALIZE_CAMPAIGN_JOB,
+ {
+ workspaceId,
+ campaignId,
+ messageChannelId: messageChannel.id,
+ emailingDomainId: emailingDomain.id,
+ recipients,
+ },
+ { retryLimit: 3 },
+ );
+
+ return { campaignId, queuedCount: recipients.length, skipped };
+ }
+
+ async processMaterializeJob(data: MaterializeCampaignJobData): Promise<void> {
+ const {
+ workspaceId,
+ campaignId,
+ messageChannelId,
+ emailingDomainId,
+ recipients,
+ } = data;
+
+ await this.globalWorkspaceOrmManager.executeInWorkspaceContext(async () => {
+ const campaignRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageCampaignWorkspaceEntity,
+ );
+
+ const campaign = await campaignRepository.findOne({
+ where: { id: campaignId },
+ });
+
+ if (campaign === null) {
+ return;
+ }
+
+ const recipientsByMessageId = new Map<string, CampaignMessageRecipient>();
+
+ for (const recipient of recipients) {
+ const messageId = this.campaignMessageId(
+ campaignId,
+ recipient.personId,
+ );
+
+ if (!recipientsByMessageId.has(messageId)) {
+ recipientsByMessageId.set(messageId, { ...recipient, messageId });
+ }
+ }
+
+ const allRecipients = [...recipientsByMessageId.values()];
+
+ const messageRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageWorkspaceEntity,
+ );
+
+ const existingMessages = await messageRepository.find({
+ where: { messageCampaignId: campaignId },
+ select: { id: true },
+ });
+ const existingMessageIds = new Set(
+ existingMessages.map((message) => message.id),
+ );
+
+ const recipientsToCreate = allRecipients.filter(
+ (recipient) => !existingMessageIds.has(recipient.messageId),
+ );
+
+ if (recipientsToCreate.length > 0) {
+ await this.materializeCampaignMessages({
+ workspaceId,
+ campaignId,
+ messageChannelId,
+ fromAddress: campaign.fromAddress?.primaryEmail ?? '',
+ subjectTemplate: campaign.subject ?? '',
+ bodyTemplate: campaign.bodyTemplate ?? '',
+ recipients: recipientsToCreate,
+ });
+ }
+
+ for (const recipient of allRecipients) {
+ await this.messageQueueService.add<SendCampaignEmailJobData>(
+ SEND_CAMPAIGN_EMAIL_JOB,
+ {
+ workspaceId,
+ campaignId,
+ messageId: recipient.messageId,
+ personId: recipient.personId,
+ recipientEmail: recipient.email,
+ emailingDomainId,
+ },
+ { retryLimit: 3 },
+ );
+ }
+
+ await this.finalizeCampaignIfComplete(workspaceId, campaignId);
+ }, buildSystemAuthContext(workspaceId));
+ }
+
+ async processSendJob(data: SendCampaignEmailJobData): Promise<void> {
+ const {
+ workspaceId,
+ campaignId,
+ messageId,
+ personId,
+ recipientEmail,
+ emailingDomainId,
+ } = data;
+
+ await this.globalWorkspaceOrmManager.executeInWorkspaceContext(async () => {
+ const messageRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageWorkspaceEntity,
+ );
+
+ const message = await messageRepository.findOne({
+ where: { id: messageId },
+ });
+
+ if (
+ message === null ||
+ (message.deliveryStatus !== CAMPAIGN_MESSAGE_DELIVERY_STATUS.QUEUED &&
+ message.deliveryStatus !== CAMPAIGN_MESSAGE_DELIVERY_STATUS.FAILED)
+ ) {
+ return;
+ }
+
+ const campaignRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageCampaignWorkspaceEntity,
+ );
+
+ const campaign = await campaignRepository.findOne({
+ where: { id: campaignId },
+ });
+
+ if (campaign === null) {
+ return;
+ }
+
+ const personRepository = await this.getSystemRepository(
+ workspaceId,
+ PersonWorkspaceEntity,
+ );
+
+ const person = await personRepository.findOne({
+ where: { id: personId },
+ });
+
+ const variables = this.buildTemplateVariables(person);
+ const subject = renderCampaignTemplate(
+ campaign.subject ?? '',
+ variables,
+ {
+ escapeValues: false,
+ },
+ );
+ const html = renderCampaignTemplate(
+ campaign.bodyTemplate ?? '',
+ variables,
+ {
+ escapeValues: true,
+ },
+ );
+ const text = this.htmlToText(html);
+ const fromAddress = campaign.fromAddress?.primaryEmail ?? '';
+ const unsubscribeTopicId = campaign.unsubscribeTopicId ?? undefined;
+
+ try {
+ let result: EmailingDomainSendEmailResult;
+
+ try {
+ result = await this.emailingDomainSenderService.sendEmail(
+ workspaceId,
+ emailingDomainId,
+ {
+ from: fromAddress,
+ to: [recipientEmail],
+ subject,
+ text,
+ html,
+ unsubscribeTopicId,
+ },
+ );
+ } catch (error) {
+ const code =
+ error instanceof EmailingDomainDriverException ? error.code : null;
+
+ if (
+ code === EmailingDomainDriverExceptionCode.ALL_RECIPIENTS_SUPPRESSED
+ ) {
+ await messageRepository.update(messageId, {
+ deliveryStatus: CAMPAIGN_MESSAGE_DELIVERY_STATUS.SKIPPED,
+ });
+
+ return;
+ }
+
+ await messageRepository.update(messageId, {
+ deliveryStatus: CAMPAIGN_MESSAGE_DELIVERY_STATUS.FAILED,
+ });
+ this.logger.warn(
+ `Campaign ${campaignId} send failed for ${recipientEmail}: ${
+ error instanceof Error ? error.message : String(error)
+ }`,
+ );
+
+ const isRetryable =
+ code === null ||
+ code === EmailingDomainDriverExceptionCode.TEMPORARY_ERROR ||
+ code === EmailingDomainDriverExceptionCode.UNKNOWN;
+
+ if (isRetryable) {
+ throw error;
+ }
+
+ return;
+ }
+
+ await messageRepository.update(messageId, {
+ deliveryStatus: CAMPAIGN_MESSAGE_DELIVERY_STATUS.SENT,
+ headerMessageId: result.messageId,
+ subject,
+ text,
+ });
+
+ const associationRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageChannelMessageAssociationWorkspaceEntity,
+ );
+
+ await associationRepository.update(
+ { messageId },
+ {
+ messageExternalId: result.messageId,
+ messageThreadExternalId: result.messageId,
+ },
+ );
+ } finally {
+ await this.finalizeCampaignIfComplete(workspaceId, campaignId);
+ }
+ }, buildSystemAuthContext(workspaceId));
+ }
+
+ async recordDeliveryFailureByProviderMessageId({
+ workspaceId,
+ providerMessageId,
+ deliveryStatus,
+ }: {
+ workspaceId: string;
+ providerMessageId: string;
+ deliveryStatus: string;
+ }): Promise<void> {
+ await this.globalWorkspaceOrmManager.executeInWorkspaceContext(async () => {
+ const messageRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageWorkspaceEntity,
+ );
+
+ const message = await messageRepository.findOne({
+ where: { headerMessageId: providerMessageId },
+ });
+
+ if (message === null || message.messageCampaignId === null) {
+ return;
+ }
+
+ if (
+ message.deliveryStatus === CAMPAIGN_MESSAGE_DELIVERY_STATUS.BOUNCED ||
+ message.deliveryStatus === CAMPAIGN_MESSAGE_DELIVERY_STATUS.COMPLAINED
+ ) {
+ return;
+ }
+
+ await messageRepository.update(message.id, { deliveryStatus });
+ }, buildSystemAuthContext(workspaceId));
+ }
+
+ private async createCampaign({
+ workspaceId,
+ subject,
+ html,
+ fromAddress,
+ unsubscribeTopicId,
+ listId,
+ }: {
+ workspaceId: string;
+ subject: string;
+ html: string;
+ fromAddress: string;
+ unsubscribeTopicId?: string;
+ listId: string;
+ }): Promise<string> {
+ const campaignRepository = await this.getUserRepository(
+ workspaceId,
+ MessageCampaignWorkspaceEntity,
+ );
+
+ const { identifiers } = await campaignRepository.insert({
+ subject,
+ bodyTemplate: html,
+ fromAddress: { primaryEmail: fromAddress, additionalEmails: null },
+ status: CAMPAIGN_STATUS.SENDING,
+ unsubscribeTopicId: unsubscribeTopicId ?? null,
+ listId,
+ });
+
+ return identifiers[0].id;
+ }
+
+ private async materializeCampaignMessages({
+ workspaceId,
+ campaignId,
+ messageChannelId,
+ fromAddress,
+ subjectTemplate,
+ bodyTemplate,
+ recipients,
+ }: {
+ workspaceId: string;
+ campaignId: string;
+ messageChannelId: string;
+ fromAddress: string;
+ subjectTemplate: string;
+ bodyTemplate: string;
+ recipients: CampaignMessageRecipient[];
+ }): Promise<void> {
+ const now = new Date();
+ const text = this.htmlToText(bodyTemplate);
+ const rows = recipients.map((recipient) => ({
+ recipient,
+ messageId: recipient.messageId,
+ threadId: v4(),
+ temporaryExternalId: v4(),
+ }));
+
+ const messageThreadRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageThreadWorkspaceEntity,
+ );
+ const messageRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageWorkspaceEntity,
+ );
+ const associationRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageChannelMessageAssociationWorkspaceEntity,
+ );
+ const participantRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageParticipantWorkspaceEntity,
+ );
+
+ const workspaceDataSource =
+ await this.globalWorkspaceOrmManager.getGlobalWorkspaceDataSource();
+
+ if (!workspaceDataSource) {
+ throw new Error(
+ `No workspace datasource available for workspace ${workspaceId}`,
+ );
+ }
+
+ await workspaceDataSource.transaction(
+ async (transactionManager: WorkspaceEntityManager) => {
+ await messageThreadRepository.insert(
+ rows.map((row) => ({ id: row.threadId })),
+ transactionManager,
+ );
+ await messageRepository.insert(
+ rows.map((row) => ({
+ id: row.messageId,
+ headerMessageId: row.temporaryExternalId,
+ subject: subjectTemplate,
+ text,
+ receivedAt: now,
+ messageThreadId: row.threadId,
+ messageCampaignId: campaignId,
+ deliveryStatus: CAMPAIGN_MESSAGE_DELIVERY_STATUS.QUEUED,
+ })),
+ transactionManager,
+ );
+ await associationRepository.insert(
+ rows.map((row) => ({
+ id: v4(),
+ messageId: row.messageId,
+ messageChannelId,
+ messageExternalId: row.temporaryExternalId,
+ messageThreadExternalId: row.temporaryExternalId,
+ direction: MessageDirection.OUTGOING,
+ })),
+ transactionManager,
+ );
+ await participantRepository.insert(
+ rows.flatMap((row) => [
+ {
+ id: v4(),
+ messageId: row.messageId,
+ role: MessageParticipantRole.FROM,
+ handle: fromAddress,
+ displayName: fromAddress,
+ },
+ {
+ id: v4(),
+ messageId: row.messageId,
+ role: MessageParticipantRole.TO,
+ handle: row.recipient.email,
+ displayName: row.recipient.email,
+ personId: row.recipient.personId,
+ messageCampaignId: campaignId,
+ },
+ ]),
+ transactionManager,
+ );
+ },
+ );
+ }
+
+ private async finalizeCampaignIfComplete(
+ workspaceId: string,
+ campaignId: string,
+ ): Promise<void> {
+ const messageRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageWorkspaceEntity,
+ );
+
+ const queuedCount = await messageRepository.count({
+ where: {
+ messageCampaignId: campaignId,
+ deliveryStatus: CAMPAIGN_MESSAGE_DELIVERY_STATUS.QUEUED,
+ },
+ });
+
+ if (queuedCount > 0) {
+ return;
+ }
+
+ const failedCount = await messageRepository.count({
+ where: {
+ messageCampaignId: campaignId,
+ deliveryStatus: CAMPAIGN_MESSAGE_DELIVERY_STATUS.FAILED,
+ },
+ });
+
+ const campaignRepository = await this.getSystemRepository(
+ workspaceId,
+ MessageCampaignWorkspaceEntity,
+ );
+
+ await campaignRepository.update(
+ { id: campaignId, status: CAMPAIGN_STATUS.SENDING },
+ {
+ status:
+ failedCount > 0
+ ? CAMPAIGN_STATUS.SENT_WITH_ERRORS
+ : CAMPAIGN_STATUS.SENT,
+ sentAt: new Date(),
+ },
+ );
+ }
+
+ async previewAudience({
+ workspaceId,
+ listId,
+ unsubscribeTopicId,
+ }: {
+ workspaceId: string;
+ listId: string;
+ unsubscribeTopicId?: string;
+ }): Promise<CampaignAudiencePreview> {
+ return this.globalWorkspaceOrmManager.executeInWorkspaceContext(
+ async () => {
+ const rawRecipients = await this.resolveRecipientsFromList(
+ workspaceId,
+ listId,
+ );
+ const totalMembers = rawRecipients.length;
+
+ const { recipients, skipped } = normalizeCampaignRecipients(
+ rawRecipients,
+ MAX_CAMPAIGN_RECIPIENTS,
+ );
+
+ const emails = recipients.map((recipient) => recipient.email);
+
+ const globallySuppressed =
+ await this.messageSuppressionService.getSuppressedAddresses(
+ workspaceId,
+ emails,
+ );
+ const topicSuppressed = isNonEmptyString(unsubscribeTopicId)
+ ? await this.messageSuppressionService.getTopicSuppressedAddresses(
+ workspaceId,
+ emails,
+ unsubscribeTopicId,
+ )
+ : new Set<string>();
+
+ let globallyUnsubscribed = 0;
+ let topicUnsubscribed = 0;
+ let sendable = 0;
+
+ for (const recipient of recipients) {
+ const normalizedEmail = recipient.email.trim().toLowerCase();
+
+ if (globallySuppressed.has(normalizedEmail)) {
+ globallyUnsubscribed += 1;
+ } else if (topicSuppressed.has(normalizedEmail)) {
+ topicUnsubscribed += 1;
+ } else {
+ sendable += 1;
+ }
+ }
+
+ return {
+ totalMembers,
+ withoutEmail: skipped.noEmail,
+ duplicateEmails: skipped.deduped,
+ globallyUnsubscribed,
+ topicUnsubscribed,
+ sendable,
+ };
+ },
+ );
+ }
+
+ private async resolveRecipientsFromList(
+ workspaceId: string,
+ listId: string,
+ ): Promise<RawCampaignRecipient[]> {
+ const listMemberRepository = await this.getUserRepository(
+ workspaceId,
+ MessageListMemberWorkspaceEntity,
+ );
+
+ const members = await listMemberRepository.find({
+ where: { listId },
+ });
+
+ return this.loadRecipientsByPersonIds(
+ workspaceId,
+ members.map((member) => member.personId),
+ );
+ }
+
+ private async loadRecipientsByPersonIds(
+ workspaceId: string,
+ personIds: string[],
+ ): Promise<RawCampaignRecipient[]> {
+ if (personIds.length === 0) {
+ return [];
+ }
+
+ const personRepository = await this.getUserRepository(
+ workspaceId,
+ PersonWorkspaceEntity,
+ );
+
+ const people = await personRepository.find({
+ where: { id: In(personIds) },
+ });
+
+ return people.map(toRawRecipient);
+ }
+
+ private buildTemplateVariables(
+ person: PersonWorkspaceEntity | null,
+ ): Record<string, string> {
+ const firstName = person?.name?.firstName ?? '';
+ const lastName = person?.name?.lastName ?? '';
+
+ return {
+ firstName,
+ lastName,
+ fullName: [firstName, lastName].filter(Boolean).join(' '),
+ email: person?.emails?.primaryEmail ?? '',
+ };
+ }
+
+ private campaignMessageId(campaignId: string, personId: string): string {
+ return v5(`${campaignId}:${personId}`, CAMPAIGN_MESSAGE_ID_NAMESPACE);
+ }
+}
diff --git a/packages/twenty-server/src/modules/emailing/services/message-suppression.service.ts b/packages/twenty-server/src/modules/emailing/services/message-suppression.service.ts
new file mode 100644
index 00000000000..0ba92f68bdf
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/services/message-suppression.service.ts
@@ -0,0 +1,277 @@
+import { Injectable } from '@nestjs/common';
+
+import { isNonEmptyString } from '@sniptt/guards';
+import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
+import { In, IsNull, QueryFailedError } from 'typeorm';
+
+import { POSTGRESQL_ERROR_CODES } from 'src/engine/api/graphql/workspace-query-runner/constants/postgres-error-codes.constants';
+import { type QueryFailedErrorWithCode } from 'src/engine/api/graphql/workspace-query-runner/utils/workspace-query-runner-graphql-api-exception-handler.util';
+import {
+ GLOBAL_BLOCKING_SUPPRESSION_REASONS,
+ HARD_SUPPRESSION_REASONS,
+} from 'src/engine/core-modules/emailing-domain/constants/hard-suppression-reasons.constant';
+import { MessageSuppressionEntity } from 'src/engine/core-modules/emailing-domain/message-suppression.entity';
+import { MessageSuppressionReason } from 'src/engine/core-modules/emailing-domain/types/message-suppression-reason.type';
+import { MessageSuppressionSource } from 'src/engine/core-modules/emailing-domain/types/message-suppression-source.type';
+import { type TopicOptOutState } from 'src/engine/core-modules/emailing-domain/types/topic-opt-out-state.type';
+import { InjectWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/inject-workspace-scoped-repository.decorator';
+import { WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/workspace-scoped-repository';
+import { UnsubscribeTopicService } from 'src/modules/emailing/services/unsubscribe-topic.service';
+
+type SuppressArgs = {
+ workspaceId: string;
+ emailAddress: string;
+ reason: MessageSuppressionReason;
+ source: MessageSuppressionSource;
+ providerEventId?: string | null;
+ unsubscribeTopicId?: string | null;
+};
+
+type TopicOptOutStateArgs = {
+ workspaceId: string;
+ emailAddress: string;
+};
+
+type SetTopicOptOutsArgs = {
+ workspaceId: string;
+ emailAddress: string;
+ keptTopicIds: string[];
+};
+
+@Injectable()
+export class MessageSuppressionService {
+ constructor(
+ @InjectWorkspaceScopedRepository(MessageSuppressionEntity)
+ private readonly suppressionRepository: WorkspaceScopedRepository<MessageSuppressionEntity>,
+ private readonly unsubscribeTopicService: UnsubscribeTopicService,
+ ) {}
+
+ async getSuppressedAddresses(
+ workspaceId: string,
+ emailAddresses: string[],
+ ): Promise<Set<string>> {
+ const normalizedAddresses = this.normalizeAddresses(emailAddresses);
+
+ if (!isNonEmptyArray(normalizedAddresses)) {
+ return new Set();
+ }
+
+ const suppressions = await this.suppressionRepository.find(workspaceId, {
+ where: {
+ emailAddress: In(normalizedAddresses),
+ reason: In(GLOBAL_BLOCKING_SUPPRESSION_REASONS),
+ unsubscribeTopicId: IsNull(),
+ },
+ });
+
+ return new Set(suppressions.map((suppression) => suppression.emailAddress));
+ }
+
+ async getTopicSuppressedAddresses(
+ workspaceId: string,
+ emailAddresses: string[],
+ unsubscribeTopicId: string,
+ ): Promise<Set<string>> {
+ const normalizedAddresses = this.normalizeAddresses(emailAddresses);
+
+ if (
+ !isNonEmptyArray(normalizedAddresses) ||
+ !isNonEmptyString(unsubscribeTopicId)
+ ) {
+ return new Set();
+ }
+
+ const suppressions = await this.suppressionRepository.find(workspaceId, {
+ where: {
+ emailAddress: In(normalizedAddresses),
+ reason: MessageSuppressionReason.UNSUBSCRIBE,
+ unsubscribeTopicId,
+ },
+ });
+
+ return new Set(suppressions.map((suppression) => suppression.emailAddress));
+ }
+
+ async suppress({
+ workspaceId,
+ emailAddress,
+ reason,
+ source,
+ providerEventId = null,
+ unsubscribeTopicId = null,
+ }: SuppressArgs): Promise<void> {
+ const normalizedEmailAddress = this.normalizeEmailAddress(emailAddress);
+
+ if (!isNonEmptyString(normalizedEmailAddress)) {
+ return;
+ }
+
+ // Hard suppressions (delivery failures) are inherently address-level: a
+ // topic-scoped BOUNCE/COMPLAINT row would block nothing (reads filter
+ // per-topic rows to UNSUBSCRIBE) while occupying the (address, topic) slot.
+ const effectiveTopicId = HARD_SUPPRESSION_REASONS.includes(reason)
+ ? null
+ : unsubscribeTopicId;
+
+ const whereKey = {
+ emailAddress: normalizedEmailAddress,
+ unsubscribeTopicId: isDefined(effectiveTopicId)
+ ? effectiveTopicId
+ : IsNull(),
+ };
+
+ const escalateExisting = async (): Promise<boolean> => {
+ const existing = await this.suppressionRepository.findOneBy(
+ workspaceId,
+ whereKey,
+ );
+
+ if (!isDefined(existing)) {
+ return false;
+ }
+
+ if (this.shouldEscalate(existing.reason, reason)) {
+ await this.suppressionRepository.update(
+ workspaceId,
+ { id: existing.id },
+ { reason, source, providerEventId },
+ );
+ }
+
+ return true;
+ };
+
+ if (await escalateExisting()) {
+ return;
+ }
+
+ try {
+ await this.suppressionRepository.insert(workspaceId, {
+ emailAddress: normalizedEmailAddress,
+ reason,
+ source,
+ providerEventId,
+ unsubscribeTopicId: effectiveTopicId,
+ });
+ } catch (error) {
+ const isUniqueViolation =
+ error instanceof QueryFailedError &&
+ (error as QueryFailedErrorWithCode).code ===
+ POSTGRESQL_ERROR_CODES.UNIQUE_VIOLATION;
+
+ if (!isUniqueViolation || !(await escalateExisting())) {
+ throw error;
+ }
+ }
+ }
+
+ async getTopicOptOutState({
+ workspaceId,
+ emailAddress,
+ }: TopicOptOutStateArgs): Promise<TopicOptOutState[]> {
+ const normalizedEmailAddress = this.normalizeEmailAddress(emailAddress);
+
+ if (!isNonEmptyString(normalizedEmailAddress)) {
+ return [];
+ }
+
+ const visibleTopics =
+ await this.unsubscribeTopicService.findPublicTopics(workspaceId);
+
+ if (!isNonEmptyArray(visibleTopics)) {
+ return [];
+ }
+
+ const optOuts = await this.suppressionRepository.find(workspaceId, {
+ where: {
+ emailAddress: normalizedEmailAddress,
+ reason: MessageSuppressionReason.UNSUBSCRIBE,
+ unsubscribeTopicId: In(visibleTopics.map((topic) => topic.id)),
+ },
+ });
+
+ const optedOutTopicIds = new Set(
+ optOuts.map((suppression) => suppression.unsubscribeTopicId),
+ );
+
+ return visibleTopics.map((topic) => ({
+ unsubscribeTopicId: topic.id,
+ topicName: topic.name,
+ optedOut: optedOutTopicIds.has(topic.id),
+ }));
+ }
+
+ async setTopicOptOuts({
+ workspaceId,
+ emailAddress,
+ keptTopicIds,
+ }: SetTopicOptOutsArgs): Promise<void> {
+ const topicStates = await this.getTopicOptOutState({
+ workspaceId,
+ emailAddress,
+ });
+ const keptTopicIdSet = new Set(keptTopicIds);
+
+ for (const topicState of topicStates) {
+ const shouldReceive = keptTopicIdSet.has(topicState.unsubscribeTopicId);
+
+ if (shouldReceive === !topicState.optedOut) {
+ continue;
+ }
+
+ if (shouldReceive) {
+ await this.liftTopicOptOut(
+ workspaceId,
+ emailAddress,
+ topicState.unsubscribeTopicId,
+ );
+ } else {
+ await this.suppress({
+ workspaceId,
+ emailAddress,
+ reason: MessageSuppressionReason.UNSUBSCRIBE,
+ source: MessageSuppressionSource.SYSTEM,
+ unsubscribeTopicId: topicState.unsubscribeTopicId,
+ });
+ }
+ }
+ }
+
+ private async liftTopicOptOut(
+ workspaceId: string,
+ emailAddress: string,
+ unsubscribeTopicId: string,
+ ): Promise<void> {
+ const normalizedEmailAddress = this.normalizeEmailAddress(emailAddress);
+
+ await this.suppressionRepository.delete(workspaceId, {
+ emailAddress: normalizedEmailAddress,
+ unsubscribeTopicId,
+ reason: MessageSuppressionReason.UNSUBSCRIBE,
+ });
+ }
+
+ private normalizeEmailAddress(emailAddress: string): string {
+ return emailAddress.trim().toLowerCase();
+ }
+
+ private normalizeAddresses(emailAddresses: string[]): string[] {
+ return [
+ ...new Set(
+ emailAddresses.map((emailAddress) =>
+ this.normalizeEmailAddress(emailAddress),
+ ),
+ ),
+ ];
+ }
+
+ private shouldEscalate(
+ existingReason: MessageSuppressionReason,
+ incomingReason: MessageSuppressionReason,
+ ): boolean {
+ return (
+ !HARD_SUPPRESSION_REASONS.includes(existingReason) &&
+ HARD_SUPPRESSION_REASONS.includes(incomingReason)
+ );
+ }
+}
diff --git a/packages/twenty-server/src/modules/emailing/services/unsubscribe-topic.service.ts b/packages/twenty-server/src/modules/emailing/services/unsubscribe-topic.service.ts
new file mode 100644
index 00000000000..de11e51b22a
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/services/unsubscribe-topic.service.ts
@@ -0,0 +1,78 @@
+import { Injectable } from '@nestjs/common';
+
+import { UnsubscribeTopicEntity } from 'src/engine/core-modules/emailing-domain/unsubscribe-topic.entity';
+import { UnsubscribeTopicVisibility } from 'src/engine/core-modules/emailing-domain/types/unsubscribe-topic-visibility.type';
+import { InjectWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/inject-workspace-scoped-repository.decorator';
+import { WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/workspace-scoped-repository';
+
+type CreateUnsubscribeTopicArgs = {
+ name: string;
+ description?: string | null;
+ visibility?: UnsubscribeTopicVisibility | null;
+};
+
+type UpdateUnsubscribeTopicArgs = {
+ id: string;
+ name?: string | null;
+ description?: string | null;
+ visibility?: UnsubscribeTopicVisibility | null;
+};
+
+@Injectable()
+export class UnsubscribeTopicService {
+ constructor(
+ @InjectWorkspaceScopedRepository(UnsubscribeTopicEntity)
+ private readonly unsubscribeTopicRepository: WorkspaceScopedRepository<UnsubscribeTopicEntity>,
+ ) {}
+
+ async getUnsubscribeTopics(
+ workspaceId: string,
+ ): Promise<UnsubscribeTopicEntity[]> {
+ return this.unsubscribeTopicRepository.find(workspaceId, {
+ order: { name: 'ASC' },
+ });
+ }
+
+ async findPublicTopics(
+ workspaceId: string,
+ ): Promise<UnsubscribeTopicEntity[]> {
+ return this.unsubscribeTopicRepository.find(workspaceId, {
+ where: { visibility: UnsubscribeTopicVisibility.PUBLIC },
+ order: { name: 'ASC' },
+ });
+ }
+
+ async createUnsubscribeTopic(
+ workspaceId: string,
+ { name, description = null, visibility }: CreateUnsubscribeTopicArgs,
+ ): Promise<UnsubscribeTopicEntity> {
+ return this.unsubscribeTopicRepository.save(workspaceId, {
+ name,
+ description,
+ visibility: visibility ?? UnsubscribeTopicVisibility.PRIVATE,
+ });
+ }
+
+ async updateUnsubscribeTopic(
+ workspaceId: string,
+ { id, name, description, visibility }: UpdateUnsubscribeTopicArgs,
+ ): Promise<UnsubscribeTopicEntity> {
+ const existing = await this.unsubscribeTopicRepository.findOneOrFail(
+ workspaceId,
+ { where: { id } },
+ );
+
+ return this.unsubscribeTopicRepository.save(workspaceId, {
+ ...existing,
+ ...(name !== undefined ? { name } : {}),
+ ...(description !== undefined ? { description } : {}),
+ ...(visibility !== undefined && visibility !== null
+ ? { visibility }
+ : {}),
+ });
+ }
+
+ async deleteUnsubscribeTopic(workspaceId: string, id: string): Promise<void> {
+ await this.unsubscribeTopicRepository.delete(workspaceId, { id });
+ }
+}
diff --git a/packages/twenty-server/src/modules/emailing/standard-objects/message-campaign.workspace-entity.ts b/packages/twenty-server/src/modules/emailing/standard-objects/message-campaign.workspace-entity.ts
new file mode 100644
index 00000000000..cca9097173d
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/standard-objects/message-campaign.workspace-entity.ts
@@ -0,0 +1,28 @@
+import { type EmailsMetadata, FieldMetadataType } from 'twenty-shared/types';
+
+import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
+import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
+import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
+import { type MessageListWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-list.workspace-entity';
+import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
+import { type MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
+
+const SUBJECT_FIELD_NAME = 'subject';
+
+export const SEARCH_FIELDS_FOR_MESSAGE_CAMPAIGN: FieldTypeAndNameMetadata[] = [
+ { name: SUBJECT_FIELD_NAME, type: FieldMetadataType.TEXT },
+];
+
+export class MessageCampaignWorkspaceEntity extends BaseWorkspaceEntity {
+ subject: string | null;
+ bodyTemplate: string | null;
+ fromAddress: EmailsMetadata | null;
+ status: string;
+ sentAt: Date | null;
+ unsubscribeTopicId: string | null;
+ list: EntityRelation<MessageListWorkspaceEntity> | null;
+ listId: string | null;
+ messages: EntityRelation<MessageWorkspaceEntity[]>;
+ recipients: EntityRelation<MessageParticipantWorkspaceEntity[]>;
+ searchVector: string;
+}
diff --git a/packages/twenty-server/src/modules/emailing/standard-objects/message-list-member.workspace-entity.ts b/packages/twenty-server/src/modules/emailing/standard-objects/message-list-member.workspace-entity.ts
new file mode 100644
index 00000000000..cb486c1fbd0
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/standard-objects/message-list-member.workspace-entity.ts
@@ -0,0 +1,12 @@
+import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
+import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
+import { type MessageListWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-list.workspace-entity';
+import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
+
+export class MessageListMemberWorkspaceEntity extends BaseWorkspaceEntity {
+ list: EntityRelation<MessageListWorkspaceEntity>;
+ listId: string;
+ person: EntityRelation<PersonWorkspaceEntity>;
+ personId: string;
+ searchVector: string;
+}
diff --git a/packages/twenty-server/src/modules/emailing/standard-objects/message-list.workspace-entity.ts b/packages/twenty-server/src/modules/emailing/standard-objects/message-list.workspace-entity.ts
new file mode 100644
index 00000000000..bc7e9a207d1
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/standard-objects/message-list.workspace-entity.ts
@@ -0,0 +1,20 @@
+import { FieldMetadataType } from 'twenty-shared/types';
+
+import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
+import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
+import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
+import { type MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
+import { type MessageListMemberWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-list-member.workspace-entity';
+
+const NAME_FIELD_NAME = 'name';
+
+export const SEARCH_FIELDS_FOR_MESSAGE_LIST: FieldTypeAndNameMetadata[] = [
+ { name: NAME_FIELD_NAME, type: FieldMetadataType.TEXT },
+];
+
+export class MessageListWorkspaceEntity extends BaseWorkspaceEntity {
+ name: string | null;
+ members: EntityRelation<MessageListMemberWorkspaceEntity[]>;
+ campaigns: EntityRelation<MessageCampaignWorkspaceEntity[]>;
+ searchVector: string;
+}
diff --git a/packages/twenty-server/src/modules/emailing/utils/render-campaign-template.util.ts b/packages/twenty-server/src/modules/emailing/utils/render-campaign-template.util.ts
new file mode 100644
index 00000000000..cf2a6bb9c86
--- /dev/null
+++ b/packages/twenty-server/src/modules/emailing/utils/render-campaign-template.util.ts
@@ -0,0 +1,14 @@
+import { escapeHtml } from 'src/engine/core-modules/emailing-domain/utils/escape-html.util';
+
+const CAMPAIGN_VARIABLE_PATTERN = /\{\{\s*([a-zA-Z][a-zA-Z0-9_]*)\s*\}\}/g;
+
+export const renderCampaignTemplate = (
+ template: string,
+ variables: Record<string, string>,
+ { escapeValues }: { escapeValues: boolean },
+): string =>
+ template.replace(CAMPAIGN_VARIABLE_PATTERN, (_match, variableName) => {
+ const value = variables[variableName] ?? '';
+
+ return escapeValues ? escapeHtml(value) : value;
+ });
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/filters/messaging-webhook-api-exception.filter.ts b/packages/twenty-server/src/modules/messaging-webhooks/filters/messaging-webhook-api-exception.filter.ts
similarity index 74%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/filters/messaging-webhook-api-exception.filter.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/filters/messaging-webhook-api-exception.filter.ts
index 024e97a1031..d54713e4df6 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/filters/messaging-webhook-api-exception.filter.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/filters/messaging-webhook-api-exception.filter.ts
@@ -7,8 +7,8 @@ import {
import { type Response } from 'express';
import { HttpExceptionHandlerService } from 'src/engine/core-modules/exception-handler/http-exception-handler.service';
-import { MessagingWebhookException } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook.exception';
-import { getMessagingWebhookExceptionStatusCode } from 'src/engine/core-modules/messaging-webhooks/utils/get-messaging-webhook-exception-status-code.util';
+import { MessagingWebhookException } from 'src/modules/messaging-webhooks/messaging-webhook.exception';
+import { getMessagingWebhookExceptionStatusCode } from 'src/modules/messaging-webhooks/utils/get-messaging-webhook-exception-status-code.util';
@Catch(MessagingWebhookException)
export class MessagingWebhookApiExceptionFilter implements ExceptionFilter {
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhook-exception-code.enum.ts b/packages/twenty-server/src/modules/messaging-webhooks/messaging-webhook-exception-code.enum.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhook-exception-code.enum.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/messaging-webhook-exception-code.enum.ts
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhook.exception.ts b/packages/twenty-server/src/modules/messaging-webhooks/messaging-webhook.exception.ts
similarity index 92%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhook.exception.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/messaging-webhook.exception.ts
index 72e9e78b418..266189bf28b 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhook.exception.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/messaging-webhook.exception.ts
@@ -2,7 +2,7 @@ import { type MessageDescriptor } from '@lingui/core';
import { msg } from '@lingui/core/macro';
import { assertUnreachable } from 'twenty-shared/utils';
-import { MessagingWebhookExceptionCode } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook-exception-code.enum';
+import { MessagingWebhookExceptionCode } from 'src/modules/messaging-webhooks/messaging-webhook-exception-code.enum';
import { CustomException } from 'src/utils/custom-exception';
const getMessagingWebhookExceptionUserFriendlyMessage = (
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhooks.controller.ts b/packages/twenty-server/src/modules/messaging-webhooks/messaging-webhooks.controller.ts
similarity index 71%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhooks.controller.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/messaging-webhooks.controller.ts
index e443d87eff8..f86a18bcc91 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/messaging-webhooks.controller.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/messaging-webhooks.controller.ts
@@ -10,11 +10,11 @@ import {
import { type Request } from 'express';
-import { MessagingWebhookApiExceptionFilter } from 'src/engine/core-modules/messaging-webhooks/filters/messaging-webhook-api-exception.filter';
-import { MessagingWebhookExceptionCode } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook-exception-code.enum';
-import { MessagingWebhookException } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook.exception';
-import { SesInboundWebhookRouterService } from 'src/engine/core-modules/messaging-webhooks/services/ses-inbound-webhook-router.service';
-import { SesOutboundWebhookRouterService } from 'src/engine/core-modules/messaging-webhooks/services/ses-outbound-webhook-router.service';
+import { MessagingWebhookApiExceptionFilter } from 'src/modules/messaging-webhooks/filters/messaging-webhook-api-exception.filter';
+import { MessagingWebhookExceptionCode } from 'src/modules/messaging-webhooks/messaging-webhook-exception-code.enum';
+import { MessagingWebhookException } from 'src/modules/messaging-webhooks/messaging-webhook.exception';
+import { SesInboundWebhookRouterService } from 'src/modules/messaging-webhooks/services/ses-inbound-webhook-router.service';
+import { SesOutboundWebhookRouterService } from 'src/modules/messaging-webhooks/services/ses-outbound-webhook-router.service';
import { NoPermissionGuard } from 'src/engine/guards/no-permission.guard';
import { PublicEndpointGuard } from 'src/engine/guards/public-endpoint.guard';
import { isDefined } from 'twenty-shared/utils';
diff --git a/packages/twenty-server/src/modules/messaging-webhooks/messaging-webhooks.module.ts b/packages/twenty-server/src/modules/messaging-webhooks/messaging-webhooks.module.ts
new file mode 100644
index 00000000000..25c3d62648d
--- /dev/null
+++ b/packages/twenty-server/src/modules/messaging-webhooks/messaging-webhooks.module.ts
@@ -0,0 +1,30 @@
+import { Module } from '@nestjs/common';
+
+import { EmailingDomainModule } from 'src/engine/core-modules/emailing-domain/emailing-domain.module';
+import { EmailingModule } from 'src/modules/emailing/emailing.module';
+import { MessagingWebhooksController } from 'src/modules/messaging-webhooks/messaging-webhooks.controller';
+import { SesInboundMailHandlerService } from 'src/modules/messaging-webhooks/services/ses-inbound-mail-handler.service';
+import { SesInboundUnsubscribeHandlerService } from 'src/modules/messaging-webhooks/services/ses-inbound-unsubscribe-handler.service';
+import { SesInboundWebhookRouterService } from 'src/modules/messaging-webhooks/services/ses-inbound-webhook-router.service';
+import { SesOutboundSendingStateHandlerService } from 'src/modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service';
+import { SesOutboundSuppressionHandlerService } from 'src/modules/messaging-webhooks/services/ses-outbound-suppression-handler.service';
+import { SesOutboundWebhookRouterService } from 'src/modules/messaging-webhooks/services/ses-outbound-webhook-router.service';
+import { SnsSignatureVerifierService } from 'src/modules/messaging-webhooks/services/sns-signature-verifier.service';
+import { SnsSubscriptionConfirmerService } from 'src/modules/messaging-webhooks/services/sns-subscription-confirmer.service';
+import { TwentyConfigModule } from 'src/engine/core-modules/twenty-config/twenty-config.module';
+
+@Module({
+ imports: [TwentyConfigModule, EmailingDomainModule, EmailingModule],
+ controllers: [MessagingWebhooksController],
+ providers: [
+ SnsSignatureVerifierService,
+ SnsSubscriptionConfirmerService,
+ SesInboundMailHandlerService,
+ SesInboundUnsubscribeHandlerService,
+ SesOutboundSendingStateHandlerService,
+ SesOutboundSuppressionHandlerService,
+ SesInboundWebhookRouterService,
+ SesOutboundWebhookRouterService,
+ ],
+})
+export class MessagingWebhooksModule {}
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/__tests__/ses-outbound-sending-state-handler.service.spec.ts b/packages/twenty-server/src/modules/messaging-webhooks/services/__tests__/ses-outbound-sending-state-handler.service.spec.ts
similarity index 91%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/__tests__/ses-outbound-sending-state-handler.service.spec.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/services/__tests__/ses-outbound-sending-state-handler.service.spec.ts
index bb532e8d152..079fb7d83d8 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/__tests__/ses-outbound-sending-state-handler.service.spec.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/services/__tests__/ses-outbound-sending-state-handler.service.spec.ts
@@ -1,7 +1,7 @@
import { EmailingDomainTenantStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-tenant-status.type';
import { type EmailingDomainTenantStatusService } from 'src/engine/core-modules/emailing-domain/services/emailing-domain-tenant-status.service';
-import { SesOutboundSendingStateHandlerService } from 'src/engine/core-modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service';
-import { type SesEventBridgeNotification } from 'src/engine/core-modules/messaging-webhooks/types/ses-event-bridge-notification.type';
+import { SesOutboundSendingStateHandlerService } from 'src/modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service';
+import { type SesEventBridgeNotification } from 'src/modules/messaging-webhooks/types/ses-event-bridge-notification.type';
describe('SesOutboundSendingStateHandlerService.handle', () => {
const setUp = () => {
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-inbound-mail-handler.service.ts b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-inbound-mail-handler.service.ts
similarity index 61%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-inbound-mail-handler.service.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/services/ses-inbound-mail-handler.service.ts
index 44f063e30bb..65f48b188a7 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-inbound-mail-handler.service.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-inbound-mail-handler.service.ts
@@ -3,7 +3,9 @@ import { Injectable, Logger } from '@nestjs/common';
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
-import { type SesInboundNotification } from 'src/engine/core-modules/messaging-webhooks/types/sns-message.type';
+import { SesInboundUnsubscribeHandlerService } from 'src/modules/messaging-webhooks/services/ses-inbound-unsubscribe-handler.service';
+import { type SesInboundNotification } from 'src/modules/messaging-webhooks/types/sns-message.type';
+import { resolveInboundMailIntent } from 'src/modules/messaging-webhooks/utils/resolve-inbound-mail-intent.util';
import {
MessagingInboundEmailImportJob,
type MessagingInboundEmailImportJobData,
@@ -16,11 +18,28 @@ export class SesInboundMailHandlerService {
constructor(
@InjectMessageQueue(MessageQueue.messagingQueue)
private readonly messageQueueService: MessageQueueService,
+ private readonly sesInboundUnsubscribeHandlerService: SesInboundUnsubscribeHandlerService,
) {}
async handle(
notification: SesInboundNotification,
snsMessageId: string,
+ ): Promise<void> {
+ switch (resolveInboundMailIntent(notification)) {
+ case 'UNSUBSCRIBE':
+ await this.sesInboundUnsubscribeHandlerService.handle(notification);
+
+ return;
+ case 'IMPORT':
+ await this.enqueueInboundEmailImport(notification, snsMessageId);
+
+ return;
+ }
+ }
+
+ private async enqueueInboundEmailImport(
+ notification: SesInboundNotification,
+ snsMessageId: string,
): Promise<void> {
const { receipt } = notification;
diff --git a/packages/twenty-server/src/modules/messaging-webhooks/services/ses-inbound-unsubscribe-handler.service.ts b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-inbound-unsubscribe-handler.service.ts
new file mode 100644
index 00000000000..46b013f49fc
--- /dev/null
+++ b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-inbound-unsubscribe-handler.service.ts
@@ -0,0 +1,52 @@
+import { Injectable, Logger } from '@nestjs/common';
+
+import { isNonEmptyString } from '@sniptt/guards';
+import { isDefined } from 'twenty-shared/utils';
+
+import { MessageSuppressionService } from 'src/modules/emailing/services/message-suppression.service';
+import { UnsubscribeTokenService } from 'src/engine/core-modules/emailing-domain/services/unsubscribe-token.service';
+import { MessageSuppressionReason } from 'src/engine/core-modules/emailing-domain/types/message-suppression-reason.type';
+import { MessageSuppressionSource } from 'src/engine/core-modules/emailing-domain/types/message-suppression-source.type';
+import { type SesInboundNotification } from 'src/modules/messaging-webhooks/types/sns-message.type';
+
+@Injectable()
+export class SesInboundUnsubscribeHandlerService {
+ private readonly logger = new Logger(
+ SesInboundUnsubscribeHandlerService.name,
+ );
+
+ constructor(
+ private readonly unsubscribeTokenService: UnsubscribeTokenService,
+ private readonly messageSuppressionService: MessageSuppressionService,
+ ) {}
+
+ async handle(notification: SesInboundNotification): Promise<void> {
+ const subject = notification.mail?.commonHeaders?.subject;
+
+ if (!isNonEmptyString(subject)) {
+ this.logger.warn('Unsubscribe email received without a token subject');
+
+ return;
+ }
+
+ const payload = this.unsubscribeTokenService.verify(subject.trim());
+
+ if (!isDefined(payload)) {
+ this.logger.warn('Unsubscribe email received with an invalid token');
+
+ return;
+ }
+
+ if (payload.preview === true) {
+ return;
+ }
+
+ await this.messageSuppressionService.suppress({
+ workspaceId: payload.workspaceId,
+ emailAddress: payload.emailAddress,
+ reason: MessageSuppressionReason.UNSUBSCRIBE,
+ source: MessageSuppressionSource.SYSTEM,
+ unsubscribeTopicId: payload.unsubscribeTopicId ?? null,
+ });
+ }
+}
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-inbound-webhook-router.service.ts b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-inbound-webhook-router.service.ts
similarity index 68%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-inbound-webhook-router.service.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/services/ses-inbound-webhook-router.service.ts
index 0f79cf4dc8f..91856ce2249 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-inbound-webhook-router.service.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-inbound-webhook-router.service.ts
@@ -3,12 +3,12 @@ import { Injectable } from '@nestjs/common';
import type SnsPayloadValidator from 'sns-payload-validator';
import { isDefined, parseJson } from 'twenty-shared/utils';
-import { MessagingWebhookExceptionCode } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook-exception-code.enum';
-import { MessagingWebhookException } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook.exception';
-import { SesInboundMailHandlerService } from 'src/engine/core-modules/messaging-webhooks/services/ses-inbound-mail-handler.service';
-import { SnsSignatureVerifierService } from 'src/engine/core-modules/messaging-webhooks/services/sns-signature-verifier.service';
-import { SnsSubscriptionConfirmerService } from 'src/engine/core-modules/messaging-webhooks/services/sns-subscription-confirmer.service';
-import { type SesInboundNotification } from 'src/engine/core-modules/messaging-webhooks/types/sns-message.type';
+import { MessagingWebhookExceptionCode } from 'src/modules/messaging-webhooks/messaging-webhook-exception-code.enum';
+import { MessagingWebhookException } from 'src/modules/messaging-webhooks/messaging-webhook.exception';
+import { SesInboundMailHandlerService } from 'src/modules/messaging-webhooks/services/ses-inbound-mail-handler.service';
+import { SnsSignatureVerifierService } from 'src/modules/messaging-webhooks/services/sns-signature-verifier.service';
+import { SnsSubscriptionConfirmerService } from 'src/modules/messaging-webhooks/services/sns-subscription-confirmer.service';
+import { type SesInboundNotification } from 'src/modules/messaging-webhooks/types/sns-message.type';
type SnsPayload = SnsPayloadValidator.SnsPayload;
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service.ts b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service.ts
similarity index 58%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service.ts
index 6cac20324e7..60f61f824ea 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service.ts
@@ -2,9 +2,9 @@ import { Injectable, Logger } from '@nestjs/common';
import { EmailingDomainTenantStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-tenant-status.type';
import { EmailingDomainTenantStatusService } from 'src/engine/core-modules/emailing-domain/services/emailing-domain-tenant-status.service';
-import { type SesEventBridgeNotification } from 'src/engine/core-modules/messaging-webhooks/types/ses-event-bridge-notification.type';
-import { parseWorkspaceIdFromAwsSesResourceArn } from 'src/engine/core-modules/messaging-webhooks/utils/parse-workspace-id-from-aws-ses-resource-arn.util';
-import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
+import { type SesEventBridgeNotification } from 'src/modules/messaging-webhooks/types/ses-event-bridge-notification.type';
+import { resolveWorkspaceIdFromAwsSesResources } from 'src/modules/messaging-webhooks/utils/resolve-workspace-id-from-aws-ses-resources.util';
+import { isDefined } from 'twenty-shared/utils';
@Injectable()
export class SesOutboundSendingStateHandlerService {
@@ -22,7 +22,7 @@ export class SesOutboundSendingStateHandlerService {
? EmailingDomainTenantStatus.ACTIVE
: EmailingDomainTenantStatus.PAUSED;
- const workspaceId = this.resolveWorkspaceIdFromResources(event.resources);
+ const workspaceId = resolveWorkspaceIdFromAwsSesResources(event.resources);
if (!isDefined(workspaceId)) {
this.logger.warn(
@@ -37,22 +37,4 @@ export class SesOutboundSendingStateHandlerService {
targetStatus,
);
}
-
- private resolveWorkspaceIdFromResources(
- resources: string[] | undefined,
- ): string | null {
- if (!isNonEmptyArray(resources)) {
- return null;
- }
-
- for (const resourceArn of resources) {
- const workspaceId = parseWorkspaceIdFromAwsSesResourceArn(resourceArn);
-
- if (isDefined(workspaceId)) {
- return workspaceId;
- }
- }
-
- return null;
- }
}
diff --git a/packages/twenty-server/src/modules/messaging-webhooks/services/ses-outbound-suppression-handler.service.ts b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-outbound-suppression-handler.service.ts
new file mode 100644
index 00000000000..99ad64fa80b
--- /dev/null
+++ b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-outbound-suppression-handler.service.ts
@@ -0,0 +1,129 @@
+import { Injectable, Logger } from '@nestjs/common';
+
+import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
+
+import { CAMPAIGN_MESSAGE_DELIVERY_STATUS } from 'src/engine/core-modules/emailing-domain/constants/campaign.constant';
+import { MessageCampaignService } from 'src/modules/emailing/services/message-campaign.service';
+import { MessageSuppressionService } from 'src/modules/emailing/services/message-suppression.service';
+import { MessageSuppressionReason } from 'src/engine/core-modules/emailing-domain/types/message-suppression-reason.type';
+import { MessageSuppressionSource } from 'src/engine/core-modules/emailing-domain/types/message-suppression-source.type';
+import { type SesEventBridgeNotification } from 'src/modules/messaging-webhooks/types/ses-event-bridge-notification.type';
+import { resolveWorkspaceIdFromAwsSesResources } from 'src/modules/messaging-webhooks/utils/resolve-workspace-id-from-aws-ses-resources.util';
+
+@Injectable()
+export class SesOutboundSuppressionHandlerService {
+ private readonly logger = new Logger(
+ SesOutboundSuppressionHandlerService.name,
+ );
+
+ constructor(
+ private readonly messageSuppressionService: MessageSuppressionService,
+ private readonly messageCampaignService: MessageCampaignService,
+ ) {}
+
+ async handle(event: SesEventBridgeNotification): Promise<void> {
+ const suppression = this.resolveSuppression(event);
+
+ if (!isDefined(suppression)) {
+ return;
+ }
+
+ const workspaceId = resolveWorkspaceIdFromAwsSesResources(event.resources);
+
+ if (!isDefined(workspaceId)) {
+ this.logger.warn(
+ `Could not resolve workspaceId from SES ${event['detail-type']} event resources: ${JSON.stringify(event.resources)}`,
+ );
+
+ return;
+ }
+
+ const providerMessageId = event.detail?.mail?.messageId;
+
+ if (isDefined(providerMessageId)) {
+ await this.messageCampaignService.recordDeliveryFailureByProviderMessageId(
+ {
+ workspaceId,
+ providerMessageId,
+ deliveryStatus:
+ event['detail-type'] === 'Email Complaint Received'
+ ? CAMPAIGN_MESSAGE_DELIVERY_STATUS.COMPLAINED
+ : CAMPAIGN_MESSAGE_DELIVERY_STATUS.BOUNCED,
+ },
+ );
+ }
+
+ const results = await Promise.allSettled(
+ suppression.emailAddresses.map((emailAddress) =>
+ this.messageSuppressionService.suppress({
+ workspaceId,
+ emailAddress,
+ reason: suppression.reason,
+ source: MessageSuppressionSource.WEBHOOK,
+ providerEventId: suppression.providerEventId,
+ }),
+ ),
+ );
+
+ if (results.some((result) => result.status === 'rejected')) {
+ throw new Error(
+ `Failed to suppress one or more recipients for ${event['detail-type']} event in workspace ${workspaceId}`,
+ );
+ }
+ }
+
+ private resolveSuppression(event: SesEventBridgeNotification): {
+ reason: MessageSuppressionReason;
+ emailAddresses: string[];
+ providerEventId: string | null;
+ } | null {
+ if (event['detail-type'] === 'Email Bounced') {
+ const bounce = event.detail?.bounce;
+
+ if (bounce?.bounceType !== 'Permanent') {
+ return null;
+ }
+
+ const emailAddresses = this.extractRecipientAddresses(
+ bounce.bouncedRecipients,
+ );
+
+ if (!isNonEmptyArray(emailAddresses)) {
+ return null;
+ }
+
+ return {
+ reason: MessageSuppressionReason.BOUNCE,
+ emailAddresses,
+ providerEventId: bounce.feedbackId ?? null,
+ };
+ }
+
+ if (event['detail-type'] === 'Email Complaint Received') {
+ const complaint = event.detail?.complaint;
+ const emailAddresses = this.extractRecipientAddresses(
+ complaint?.complainedRecipients,
+ );
+
+ if (!isNonEmptyArray(emailAddresses)) {
+ return null;
+ }
+
+ return {
+ reason: MessageSuppressionReason.COMPLAINT,
+ emailAddresses,
+ providerEventId: complaint?.feedbackId ?? null,
+ };
+ }
+
+ return null;
+ }
+
+ private extractRecipientAddresses = (
+ recipients: { emailAddress: string }[] | undefined,
+ ): string[] => {
+ return (recipients ?? [])
+ .map((recipient) => recipient.emailAddress)
+ .filter(isDefined);
+ };
+}
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-outbound-webhook-router.service.ts b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-outbound-webhook-router.service.ts
similarity index 57%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-outbound-webhook-router.service.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/services/ses-outbound-webhook-router.service.ts
index 3f174f941e0..92c03c52552 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/ses-outbound-webhook-router.service.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/services/ses-outbound-webhook-router.service.ts
@@ -3,12 +3,13 @@ import { Injectable } from '@nestjs/common';
import type SnsPayloadValidator from 'sns-payload-validator';
import { isDefined, parseJson } from 'twenty-shared/utils';
-import { MessagingWebhookExceptionCode } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook-exception-code.enum';
-import { MessagingWebhookException } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook.exception';
-import { SesOutboundSendingStateHandlerService } from 'src/engine/core-modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service';
-import { SnsSignatureVerifierService } from 'src/engine/core-modules/messaging-webhooks/services/sns-signature-verifier.service';
-import { SnsSubscriptionConfirmerService } from 'src/engine/core-modules/messaging-webhooks/services/sns-subscription-confirmer.service';
-import { type SesEventBridgeNotification } from 'src/engine/core-modules/messaging-webhooks/types/ses-event-bridge-notification.type';
+import { MessagingWebhookExceptionCode } from 'src/modules/messaging-webhooks/messaging-webhook-exception-code.enum';
+import { MessagingWebhookException } from 'src/modules/messaging-webhooks/messaging-webhook.exception';
+import { SesOutboundSendingStateHandlerService } from 'src/modules/messaging-webhooks/services/ses-outbound-sending-state-handler.service';
+import { SesOutboundSuppressionHandlerService } from 'src/modules/messaging-webhooks/services/ses-outbound-suppression-handler.service';
+import { SnsSignatureVerifierService } from 'src/modules/messaging-webhooks/services/sns-signature-verifier.service';
+import { SnsSubscriptionConfirmerService } from 'src/modules/messaging-webhooks/services/sns-subscription-confirmer.service';
+import { type SesEventBridgeNotification } from 'src/modules/messaging-webhooks/types/ses-event-bridge-notification.type';
type SnsPayload = SnsPayloadValidator.SnsPayload;
@@ -18,6 +19,7 @@ export class SesOutboundWebhookRouterService {
private readonly snsSignatureVerifierService: SnsSignatureVerifierService,
private readonly snsSubscriptionConfirmerService: SnsSubscriptionConfirmerService,
private readonly sesOutboundSendingStateHandlerService: SesOutboundSendingStateHandlerService,
+ private readonly sesOutboundSuppressionHandlerService: SesOutboundSuppressionHandlerService,
) {}
async route(rawBody: Buffer): Promise<void> {
@@ -54,6 +56,15 @@ export class SesOutboundWebhookRouterService {
);
}
+ if (
+ event['detail-type'] === 'Email Bounced' ||
+ event['detail-type'] === 'Email Complaint Received'
+ ) {
+ await this.sesOutboundSuppressionHandlerService.handle(event);
+
+ return;
+ }
+
await this.sesOutboundSendingStateHandlerService.handle(event);
}
}
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/sns-signature-verifier.service.ts b/packages/twenty-server/src/modules/messaging-webhooks/services/sns-signature-verifier.service.ts
similarity index 87%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/sns-signature-verifier.service.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/services/sns-signature-verifier.service.ts
index d906c72e78d..9cbdbf55b5b 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/sns-signature-verifier.service.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/services/sns-signature-verifier.service.ts
@@ -2,8 +2,8 @@ import { Injectable, Logger } from '@nestjs/common';
import SnsPayloadValidator from 'sns-payload-validator';
-import { MessagingWebhookExceptionCode } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook-exception-code.enum';
-import { MessagingWebhookException } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook.exception';
+import { MessagingWebhookExceptionCode } from 'src/modules/messaging-webhooks/messaging-webhook-exception-code.enum';
+import { MessagingWebhookException } from 'src/modules/messaging-webhooks/messaging-webhook.exception';
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
type SnsPayload = SnsPayloadValidator.SnsPayload;
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/sns-subscription-confirmer.service.ts b/packages/twenty-server/src/modules/messaging-webhooks/services/sns-subscription-confirmer.service.ts
similarity index 83%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/sns-subscription-confirmer.service.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/services/sns-subscription-confirmer.service.ts
index 4fe16743b78..6b21c564e12 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/services/sns-subscription-confirmer.service.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/services/sns-subscription-confirmer.service.ts
@@ -1,7 +1,7 @@
import { Injectable, Logger } from '@nestjs/common';
-import { MessagingWebhookExceptionCode } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook-exception-code.enum';
-import { MessagingWebhookException } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook.exception';
+import { MessagingWebhookExceptionCode } from 'src/modules/messaging-webhooks/messaging-webhook-exception-code.enum';
+import { MessagingWebhookException } from 'src/modules/messaging-webhooks/messaging-webhook.exception';
const SNS_SUBSCRIBE_URL_PATTERN =
/^https:\/\/sns\.[a-z0-9-]+\.amazonaws\.com\//;
diff --git a/packages/twenty-server/src/modules/messaging-webhooks/types/ses-event-bridge-notification.type.ts b/packages/twenty-server/src/modules/messaging-webhooks/types/ses-event-bridge-notification.type.ts
new file mode 100644
index 00000000000..2a164a16bd0
--- /dev/null
+++ b/packages/twenty-server/src/modules/messaging-webhooks/types/ses-event-bridge-notification.type.ts
@@ -0,0 +1,37 @@
+type SesEventBridgeDetailType =
+ | 'Sending Status Enabled'
+ | 'Sending Status Disabled'
+ | 'Email Bounced'
+ | 'Email Complaint Received';
+
+type SesEventBridgeRecipient = {
+ emailAddress: string;
+};
+
+export type SesEventBridgeNotification = {
+ source: 'aws.ses';
+ 'detail-type': SesEventBridgeDetailType;
+ resources?: string[];
+ detail?: {
+ version?: string;
+ data?: {
+ origin?: string;
+ record?: {
+ status?: 'ENABLED' | 'DISABLED';
+ cause?: string;
+ };
+ };
+ bounce?: {
+ bounceType?: 'Permanent' | 'Transient' | 'Undetermined';
+ feedbackId?: string;
+ bouncedRecipients?: SesEventBridgeRecipient[];
+ };
+ complaint?: {
+ feedbackId?: string;
+ complainedRecipients?: SesEventBridgeRecipient[];
+ };
+ mail?: {
+ messageId?: string;
+ };
+ };
+};
diff --git a/packages/twenty-server/src/modules/messaging-webhooks/types/ses-inbound-mail-intent.type.ts b/packages/twenty-server/src/modules/messaging-webhooks/types/ses-inbound-mail-intent.type.ts
new file mode 100644
index 00000000000..edf409cd281
--- /dev/null
+++ b/packages/twenty-server/src/modules/messaging-webhooks/types/ses-inbound-mail-intent.type.ts
@@ -0,0 +1 @@
+export type SesInboundMailIntent = 'UNSUBSCRIBE' | 'IMPORT';
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/types/sns-message.type.ts b/packages/twenty-server/src/modules/messaging-webhooks/types/sns-message.type.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/types/sns-message.type.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/types/sns-message.type.ts
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/utils/__tests__/parse-workspace-id-from-aws-ses-resource-arn.util.spec.ts b/packages/twenty-server/src/modules/messaging-webhooks/utils/__tests__/parse-workspace-id-from-aws-ses-resource-arn.util.spec.ts
similarity index 93%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/utils/__tests__/parse-workspace-id-from-aws-ses-resource-arn.util.spec.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/utils/__tests__/parse-workspace-id-from-aws-ses-resource-arn.util.spec.ts
index fc3deed65f5..1fa90ac23ae 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/utils/__tests__/parse-workspace-id-from-aws-ses-resource-arn.util.spec.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/utils/__tests__/parse-workspace-id-from-aws-ses-resource-arn.util.spec.ts
@@ -1,4 +1,4 @@
-import { parseWorkspaceIdFromAwsSesResourceArn } from 'src/engine/core-modules/messaging-webhooks/utils/parse-workspace-id-from-aws-ses-resource-arn.util';
+import { parseWorkspaceIdFromAwsSesResourceArn } from 'src/modules/messaging-webhooks/utils/parse-workspace-id-from-aws-ses-resource-arn.util';
describe('parseWorkspaceIdFromAwsSesResourceArn', () => {
// Tenant ARNs have an AWS-assigned opaque id segment after the tenant name
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/utils/get-messaging-webhook-exception-status-code.util.ts b/packages/twenty-server/src/modules/messaging-webhooks/utils/get-messaging-webhook-exception-status-code.util.ts
similarity index 77%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/utils/get-messaging-webhook-exception-status-code.util.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/utils/get-messaging-webhook-exception-status-code.util.ts
index f8cd019a66f..e066a82a8ff 100644
--- a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/utils/get-messaging-webhook-exception-status-code.util.ts
+++ b/packages/twenty-server/src/modules/messaging-webhooks/utils/get-messaging-webhook-exception-status-code.util.ts
@@ -1,7 +1,7 @@
import { assertUnreachable } from 'twenty-shared/utils';
-import { MessagingWebhookExceptionCode } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook-exception-code.enum';
-import { type MessagingWebhookException } from 'src/engine/core-modules/messaging-webhooks/messaging-webhook.exception';
+import { MessagingWebhookExceptionCode } from 'src/modules/messaging-webhooks/messaging-webhook-exception-code.enum';
+import { type MessagingWebhookException } from 'src/modules/messaging-webhooks/messaging-webhook.exception';
export const getMessagingWebhookExceptionStatusCode = (
exception: MessagingWebhookException,
diff --git a/packages/twenty-server/src/engine/core-modules/messaging-webhooks/utils/parse-workspace-id-from-aws-ses-resource-arn.util.ts b/packages/twenty-server/src/modules/messaging-webhooks/utils/parse-workspace-id-from-aws-ses-resource-arn.util.ts
similarity index 100%
rename from packages/twenty-server/src/engine/core-modules/messaging-webhooks/utils/parse-workspace-id-from-aws-ses-resource-arn.util.ts
rename to packages/twenty-server/src/modules/messaging-webhooks/utils/parse-workspace-id-from-aws-ses-resource-arn.util.ts
diff --git a/packages/twenty-server/src/modules/messaging-webhooks/utils/resolve-inbound-mail-intent.util.ts b/packages/twenty-server/src/modules/messaging-webhooks/utils/resolve-inbound-mail-intent.util.ts
new file mode 100644
index 00000000000..e2abdadfc02
--- /dev/null
+++ b/packages/twenty-server/src/modules/messaging-webhooks/utils/resolve-inbound-mail-intent.util.ts
@@ -0,0 +1,16 @@
+import { UNSUBSCRIBE_MAILBOX_LOCAL_PART } from 'src/engine/core-modules/emailing-domain/constants/unsubscribe-mailbox.constant';
+import { type SesInboundMailIntent } from 'src/modules/messaging-webhooks/types/ses-inbound-mail-intent.type';
+import { type SesInboundNotification } from 'src/modules/messaging-webhooks/types/sns-message.type';
+
+export const resolveInboundMailIntent = (
+ notification: SesInboundNotification,
+): SesInboundMailIntent => {
+ const isAddressedToUnsubscribeMailbox = (
+ notification.receipt?.recipients ?? []
+ ).some(
+ (recipient) =>
+ recipient.split('@')[0]?.toLowerCase() === UNSUBSCRIBE_MAILBOX_LOCAL_PART,
+ );
+
+ return isAddressedToUnsubscribeMailbox ? 'UNSUBSCRIBE' : 'IMPORT';
+};
diff --git a/packages/twenty-server/src/modules/messaging-webhooks/utils/resolve-workspace-id-from-aws-ses-resources.util.ts b/packages/twenty-server/src/modules/messaging-webhooks/utils/resolve-workspace-id-from-aws-ses-resources.util.ts
new file mode 100644
index 00000000000..5d6a84b143b
--- /dev/null
+++ b/packages/twenty-server/src/modules/messaging-webhooks/utils/resolve-workspace-id-from-aws-ses-resources.util.ts
@@ -0,0 +1,21 @@
+import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
+
+import { parseWorkspaceIdFromAwsSesResourceArn } from 'src/modules/messaging-webhooks/utils/parse-workspace-id-from-aws-ses-resource-arn.util';
+
+export const resolveWorkspaceIdFromAwsSesResources = (
+ resources: string[] | undefined,
+): string | null => {
+ if (!isNonEmptyArray(resources)) {
+ return null;
+ }
+
+ for (const resourceArn of resources) {
+ const workspaceId = parseWorkspaceIdFromAwsSesResourceArn(resourceArn);
+
+ if (isDefined(workspaceId)) {
+ return workspaceId;
+ }
+ }
+
+ return null;
+};
diff --git a/packages/twenty-server/src/modules/messaging/common/query-hooks/message/apply-messages-visibility-restrictions.service.spec.ts b/packages/twenty-server/src/modules/messaging/common/query-hooks/message/apply-messages-visibility-restrictions.service.spec.ts
index ac718c9b47c..daf69615c76 100644
--- a/packages/twenty-server/src/modules/messaging/common/query-hooks/message/apply-messages-visibility-restrictions.service.spec.ts
+++ b/packages/twenty-server/src/modules/messaging/common/query-hooks/message/apply-messages-visibility-restrictions.service.spec.ts
@@ -26,6 +26,9 @@ const createMockMessage = (
messageThread: null,
messageChannelMessageAssociations: [],
messageParticipants: [],
+ messageCampaign: null,
+ messageCampaignId: null,
+ deliveryStatus: null,
deletedAt: null,
createdAt: '2024-03-20T09:00:00Z',
updatedAt: '2024-03-20T09:00:00Z',
diff --git a/packages/twenty-server/src/modules/messaging/common/query-hooks/message/apply-messages-visibility-restrictions.service.ts b/packages/twenty-server/src/modules/messaging/common/query-hooks/message/apply-messages-visibility-restrictions.service.ts
index 7a674c53cdd..2674f840cbd 100644
--- a/packages/twenty-server/src/modules/messaging/common/query-hooks/message/apply-messages-visibility-restrictions.service.ts
+++ b/packages/twenty-server/src/modules/messaging/common/query-hooks/message/apply-messages-visibility-restrictions.service.ts
@@ -7,7 +7,6 @@ import { MessageChannelVisibility } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { In, Repository } from 'typeorm';
-import { NotFoundError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
import { UserWorkspaceEntity } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
import { ConnectedAccountEntity } from 'src/engine/metadata-modules/connected-account/entities/connected-account.entity';
import { MessageChannelEntity } from 'src/engine/metadata-modules/message-channel/entities/message-channel.entity';
@@ -90,7 +89,8 @@ export class ApplyMessagesVisibilityRestrictionsService {
.filter(isDefined);
if (messageChannels.length === 0) {
- throw new NotFoundError('Associated message channels not found');
+ messages.splice(i, 1);
+ continue;
}
const messageChannelsGroupByVisibility = groupBy(
diff --git a/packages/twenty-server/src/modules/messaging/common/standard-objects/message-participant.workspace-entity.ts b/packages/twenty-server/src/modules/messaging/common/standard-objects/message-participant.workspace-entity.ts
index 32612bf06c7..4977aae6ee8 100644
--- a/packages/twenty-server/src/modules/messaging/common/standard-objects/message-participant.workspace-entity.ts
+++ b/packages/twenty-server/src/modules/messaging/common/standard-objects/message-participant.workspace-entity.ts
@@ -4,6 +4,7 @@ import {
} from 'twenty-shared/types';
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
+import { type MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
import { type MessageWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message.workspace-entity';
@@ -25,4 +26,6 @@ export class MessageParticipantWorkspaceEntity extends BaseWorkspaceEntity {
personId: string | null;
workspaceMember: EntityRelation<WorkspaceMemberWorkspaceEntity> | null;
workspaceMemberId: string | null;
+ messageCampaign: EntityRelation<MessageCampaignWorkspaceEntity> | null;
+ messageCampaignId: string | null;
}
diff --git a/packages/twenty-server/src/modules/messaging/common/standard-objects/message.workspace-entity.ts b/packages/twenty-server/src/modules/messaging/common/standard-objects/message.workspace-entity.ts
index 6ced964511f..8acc1a9fede 100644
--- a/packages/twenty-server/src/modules/messaging/common/standard-objects/message.workspace-entity.ts
+++ b/packages/twenty-server/src/modules/messaging/common/standard-objects/message.workspace-entity.ts
@@ -3,6 +3,7 @@ import { FieldMetadataType } from 'twenty-shared/types';
import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity';
import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/utils/get-ts-vector-column-expression.util';
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
+import { type MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
import { type MessageChannelMessageAssociationWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-channel-message-association.workspace-entity';
import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
import { type MessageThreadWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-thread.workspace-entity';
@@ -24,4 +25,7 @@ export class MessageWorkspaceEntity extends BaseWorkspaceEntity {
messageChannelMessageAssociations: EntityRelation<
MessageChannelMessageAssociationWorkspaceEntity[]
>;
+ messageCampaign: EntityRelation<MessageCampaignWorkspaceEntity> | null;
+ messageCampaignId: string | null;
+ deliveryStatus: string | null;
}
diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/messaging-import-manager.module.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/messaging-import-manager.module.ts
index ca9e7d04e3a..a39f91e7c0a 100644
--- a/packages/twenty-server/src/modules/messaging/message-import-manager/messaging-import-manager.module.ts
+++ b/packages/twenty-server/src/modules/messaging/message-import-manager/messaging-import-manager.module.ts
@@ -54,7 +54,6 @@ import { MessagingMessagesImportService } from 'src/modules/messaging/message-im
import { MessagingProcessFolderActionsService } from 'src/modules/messaging/message-import-manager/services/messaging-process-folder-actions.service';
import { MessagingProcessGroupEmailActionsService } from 'src/modules/messaging/message-import-manager/services/messaging-process-group-email-actions.service';
import { MessagingSaveMessagesAndEnqueueContactCreationService } from 'src/modules/messaging/message-import-manager/services/messaging-save-messages-and-enqueue-contact-creation.service';
-import { MessagingWebhooksModule } from 'src/engine/core-modules/messaging-webhooks/messaging-webhooks.module';
import { provideWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/provide-workspace-scoped-repository';
import { MessageParticipantManagerModule } from 'src/modules/messaging/message-participant-manager/message-participant-manager.module';
import { MessagingMonitoringModule } from 'src/modules/messaging/monitoring/messaging-monitoring.module';
@@ -86,7 +85,6 @@ import { MessagingMonitoringModule } from 'src/modules/messaging/monitoring/mess
MessagingMessageCleanerModule,
WorkspaceEventEmitterModule,
ConnectedAccountModule,
- MessagingWebhooksModule,
],
providers: [
provideWorkspaceScopedRepository(MessageChannelEntity),
diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/types/message.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/types/message.ts
index 96d2efbed1c..044c1606b1a 100644
--- a/packages/twenty-server/src/modules/messaging/message-import-manager/types/message.ts
+++ b/packages/twenty-server/src/modules/messaging/message-import-manager/types/message.ts
@@ -13,6 +13,9 @@ export type Message = Omit<
| 'messageThreadId'
| 'messageFolders'
| 'id'
+ | 'messageCampaign'
+ | 'messageCampaignId'
+ | 'deliveryStatus'
> & {
attachments: {
filename: string;
@@ -43,6 +46,8 @@ export type MessageParticipant = Omit<
| 'workspaceMember'
| 'message'
| 'messageId'
+ | 'messageCampaign'
+ | 'messageCampaignId'
>;
export type MessageWithParticipants = Message & {
diff --git a/packages/twenty-server/src/modules/messaging/message-import-manager/utils/filter-out-internals.util.ts b/packages/twenty-server/src/modules/messaging/message-import-manager/utils/filter-out-internals.util.ts
index c4a24e38c85..4ade3c21c9c 100644
--- a/packages/twenty-server/src/modules/messaging/message-import-manager/utils/filter-out-internals.util.ts
+++ b/packages/twenty-server/src/modules/messaging/message-import-manager/utils/filter-out-internals.util.ts
@@ -1,7 +1,7 @@
import { isDefined } from 'twenty-shared/utils';
import { type MessageWithParticipants } from 'src/modules/messaging/message-import-manager/types/message';
-import { getDomainNameByEmail } from 'src/utils/get-domain-name-by-email';
+import { getDomainFromEmailOrThrow } from 'src/utils/get-domain-from-email-or-throw';
export const filterOutInternals = (
primaryHandle: string,
@@ -12,7 +12,7 @@ export const filterOutInternals = (
return true;
}
- const primaryHandleDomain = getDomainNameByEmail(primaryHandle);
+ const primaryHandleDomain = getDomainFromEmailOrThrow(primaryHandle);
try {
const isAllHandlesFromSameDomain = message.participants
@@ -20,7 +20,8 @@ export const filterOutInternals = (
.every(
(participant) =>
isDefined(participant.handle) &&
- getDomainNameByEmail(participant.handle) === primaryHandleDomain,
+ getDomainFromEmailOrThrow(participant.handle) ===
+ primaryHandleDomain,
);
if (isAllHandlesFromSameDomain) {
diff --git a/packages/twenty-server/src/modules/messaging/message-outbound-manager/drivers/email-group/services/email-group-message-outbound.service.ts b/packages/twenty-server/src/modules/messaging/message-outbound-manager/drivers/email-group/services/email-group-message-outbound.service.ts
index 164e18bcfa2..a847c5c1482 100644
--- a/packages/twenty-server/src/modules/messaging/message-outbound-manager/drivers/email-group/services/email-group-message-outbound.service.ts
+++ b/packages/twenty-server/src/modules/messaging/message-outbound-manager/drivers/email-group/services/email-group-message-outbound.service.ts
@@ -5,7 +5,7 @@ import { isDefined } from 'twenty-shared/utils';
import { EmailingDomainStatus } from 'src/engine/core-modules/emailing-domain/drivers/types/emailing-domain-status.type';
import { EmailingDomainEntity } from 'src/engine/core-modules/emailing-domain/emailing-domain.entity';
-import { EmailingDomainService } from 'src/engine/core-modules/emailing-domain/services/emailing-domain.service';
+import { EmailingDomainSenderService } from 'src/modules/emailing/services/emailing-domain-sender.service';
import { type ConnectedAccountEntity } from 'src/engine/metadata-modules/connected-account/entities/connected-account.entity';
import {
MessageChannelException,
@@ -16,13 +16,14 @@ import { WorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scope
import { type MessageOutboundDriver } from 'src/modules/messaging/message-outbound-manager/interfaces/message-outbound-driver.interface';
import { type SendMessageInput } from 'src/modules/messaging/message-outbound-manager/types/send-message-input.type';
import { type SendMessageResult } from 'src/modules/messaging/message-outbound-manager/types/send-message-result.type';
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
@Injectable()
export class EmailGroupMessageOutboundService implements MessageOutboundDriver {
constructor(
@InjectWorkspaceScopedRepository(EmailingDomainEntity)
private readonly emailingDomainRepository: WorkspaceScopedRepository<EmailingDomainEntity>,
- private readonly emailingDomainService: EmailingDomainService,
+ private readonly emailingDomainSenderService: EmailingDomainSenderService,
) {}
async sendMessage(
@@ -38,7 +39,7 @@ export class EmailGroupMessageOutboundService implements MessageOutboundDriver {
);
}
- const result = await this.emailingDomainService.sendEmail(
+ const result = await this.emailingDomainSenderService.sendEmail(
connectedAccount.workspaceId,
emailingDomain.id,
{
@@ -59,6 +60,7 @@ export class EmailGroupMessageOutboundService implements MessageOutboundDriver {
return {
headerMessageId: result.messageId,
messageExternalId: result.messageId,
+ deliveredRecipients: result.deliveredRecipients,
};
}
@@ -72,7 +74,7 @@ export class EmailGroupMessageOutboundService implements MessageOutboundDriver {
private async resolveEmailingDomain(
connectedAccount: ConnectedAccountEntity,
): Promise<EmailingDomainEntity> {
- const handleDomain = connectedAccount.handle.split('@')[1];
+ const handleDomain = getDomainFromEmail(connectedAccount.handle);
if (!isNonEmptyString(handleDomain)) {
throw new MessageChannelException(
diff --git a/packages/twenty-server/src/modules/messaging/message-outbound-manager/messaging-send-manager.module.ts b/packages/twenty-server/src/modules/messaging/message-outbound-manager/messaging-send-manager.module.ts
index 3d670766e8e..7dcb1a4e241 100644
--- a/packages/twenty-server/src/modules/messaging/message-outbound-manager/messaging-send-manager.module.ts
+++ b/packages/twenty-server/src/modules/messaging/message-outbound-manager/messaging-send-manager.module.ts
@@ -1,8 +1,8 @@
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
-import { EmailingDomainModule } from 'src/engine/core-modules/emailing-domain/emailing-domain.module';
import { EmailingDomainEntity } from 'src/engine/core-modules/emailing-domain/emailing-domain.entity';
+import { EmailingModule } from 'src/modules/emailing/emailing.module';
import { MessageChannelEntity } from 'src/engine/metadata-modules/message-channel/entities/message-channel.entity';
import { MessageFolderEntity } from 'src/engine/metadata-modules/message-folder/entities/message-folder.entity';
import { provideWorkspaceScopedRepository } from 'src/engine/twenty-orm/workspace-scoped-repository/provide-workspace-scoped-repository';
@@ -24,7 +24,7 @@ import { SentMessagePersistenceService } from 'src/modules/messaging/message-out
MessagingIMAPDriverModule,
MessagingSmtpDriverModule,
MessagingImportManagerModule,
- EmailingDomainModule,
+ EmailingModule,
TypeOrmModule.forFeature([
MessageChannelEntity,
MessageFolderEntity,
diff --git a/packages/twenty-server/src/modules/messaging/message-outbound-manager/services/send-email.service.ts b/packages/twenty-server/src/modules/messaging/message-outbound-manager/services/send-email.service.ts
index 7efef50d5ec..a30ab4b0423 100644
--- a/packages/twenty-server/src/modules/messaging/message-outbound-manager/services/send-email.service.ts
+++ b/packages/twenty-server/src/modules/messaging/message-outbound-manager/services/send-email.service.ts
@@ -42,7 +42,7 @@ export class SendEmailService {
sendResult,
subject: data.sanitizedSubject,
body: data.plainTextBody,
- recipients: data.recipients,
+ recipients: sendResult.deliveredRecipients ?? data.recipients,
connectedAccount: data.connectedAccount,
messageChannelId: data.messageChannelId!,
inReplyTo: data.inReplyTo,
diff --git a/packages/twenty-server/src/modules/messaging/message-outbound-manager/types/send-message-result.type.ts b/packages/twenty-server/src/modules/messaging/message-outbound-manager/types/send-message-result.type.ts
index 7fae8ad771e..c659a5ce898 100644
--- a/packages/twenty-server/src/modules/messaging/message-outbound-manager/types/send-message-result.type.ts
+++ b/packages/twenty-server/src/modules/messaging/message-outbound-manager/types/send-message-result.type.ts
@@ -2,4 +2,5 @@ export type SendMessageResult = {
headerMessageId: string;
messageExternalId?: string;
threadExternalId?: string;
+ deliveredRecipients?: { to: string[]; cc: string[]; bcc: string[] };
};
diff --git a/packages/twenty-server/src/modules/person/standard-objects/person.workspace-entity.ts b/packages/twenty-server/src/modules/person/standard-objects/person.workspace-entity.ts
index 36359c761b0..a2c219008ea 100644
--- a/packages/twenty-server/src/modules/person/standard-objects/person.workspace-entity.ts
+++ b/packages/twenty-server/src/modules/person/standard-objects/person.workspace-entity.ts
@@ -14,6 +14,7 @@ import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migr
import { type AttachmentWorkspaceEntity } from 'src/modules/attachment/standard-objects/attachment.workspace-entity';
import { type CalendarEventParticipantWorkspaceEntity } from 'src/modules/calendar/common/standard-objects/calendar-event-participant.workspace-entity';
import { type CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/company.workspace-entity';
+import { type MessageListMemberWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-list-member.workspace-entity';
import { type MessageParticipantWorkspaceEntity } from 'src/modules/messaging/common/standard-objects/message-participant.workspace-entity';
import { type NoteTargetWorkspaceEntity } from 'src/modules/note/standard-objects/note-target.workspace-entity';
import { type OpportunityWorkspaceEntity } from 'src/modules/opportunity/standard-objects/opportunity.workspace-entity';
@@ -57,5 +58,6 @@ export class PersonWorkspaceEntity extends BaseWorkspaceEntity {
CalendarEventParticipantWorkspaceEntity[]
>;
timelineActivities: EntityRelation<TimelineActivityWorkspaceEntity[]>;
+ listMemberships: EntityRelation<MessageListMemberWorkspaceEntity[]>;
searchVector: string;
}
diff --git a/packages/twenty-server/src/modules/timeline/standard-objects/timeline-activity.workspace-entity.ts b/packages/twenty-server/src/modules/timeline/standard-objects/timeline-activity.workspace-entity.ts
index 4aa900e7cd7..b524aefc243 100644
--- a/packages/twenty-server/src/modules/timeline/standard-objects/timeline-activity.workspace-entity.ts
+++ b/packages/twenty-server/src/modules/timeline/standard-objects/timeline-activity.workspace-entity.ts
@@ -6,6 +6,8 @@ import { type FieldTypeAndNameMetadata } from 'src/engine/workspace-manager/util
import { type EntityRelation } from 'src/engine/workspace-manager/workspace-migration/types/entity-relation.interface';
import { type CompanyWorkspaceEntity } from 'src/modules/company/standard-objects/company.workspace-entity';
import { type DashboardWorkspaceEntity } from 'src/modules/dashboard/standard-objects/dashboard.workspace-entity';
+import { type MessageCampaignWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-campaign.workspace-entity';
+import { type MessageListWorkspaceEntity } from 'src/modules/emailing/standard-objects/message-list.workspace-entity';
import { type NoteWorkspaceEntity } from 'src/modules/note/standard-objects/note.workspace-entity';
import { type OpportunityWorkspaceEntity } from 'src/modules/opportunity/standard-objects/opportunity.workspace-entity';
import { type PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
@@ -48,6 +50,10 @@ export class TimelineActivityWorkspaceEntity extends BaseWorkspaceEntity {
targetWorkflowRunId: string | null;
targetDashboard: EntityRelation<DashboardWorkspaceEntity> | null;
targetDashboardId: string | null;
+ targetMessageList: EntityRelation<MessageListWorkspaceEntity> | null;
+ targetMessageListId: string | null;
+ targetMessageCampaign: EntityRelation<MessageCampaignWorkspaceEntity> | null;
+ targetMessageCampaignId: string | null;
custom: EntityRelation<CustomWorkspaceEntity>;
targetCustom: EntityRelation<CustomWorkspaceEntity>;
}
diff --git a/packages/twenty-server/src/utils/__test__/get-domain-name-by-email.spec.ts b/packages/twenty-server/src/utils/__test__/get-domain-from-email-or-throw.spec.ts
similarity index 54%
rename from packages/twenty-server/src/utils/__test__/get-domain-name-by-email.spec.ts
rename to packages/twenty-server/src/utils/__test__/get-domain-from-email-or-throw.spec.ts
index e28b2ccb9db..f66d3035746 100644
--- a/packages/twenty-server/src/utils/__test__/get-domain-name-by-email.spec.ts
+++ b/packages/twenty-server/src/utils/__test__/get-domain-from-email-or-throw.spec.ts
@@ -2,21 +2,21 @@ import {
ErrorCode,
UserInputError,
} from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
-import { getDomainNameByEmail } from 'src/utils/get-domain-name-by-email';
+import { getDomainFromEmailOrThrow } from 'src/utils/get-domain-from-email-or-throw';
-describe('getDomainNameByEmail', () => {
+describe('getDomainFromEmailOrThrow', () => {
it('should return the domain name for a valid email', () => {
- expect(getDomainNameByEmail('[email protected]')).toBe('example.com');
+ expect(getDomainFromEmailOrThrow('[email protected]')).toBe('example.com');
});
it('should throw a UserInputError if email is empty', () => {
- expect(() => getDomainNameByEmail('')).toThrow(UserInputError);
- expect(() => getDomainNameByEmail('')).toThrow(
+ expect(() => getDomainFromEmailOrThrow('')).toThrow(UserInputError);
+ expect(() => getDomainFromEmailOrThrow('')).toThrow(
'Email is required. Please provide a valid email address.',
);
try {
- getDomainNameByEmail('');
+ getDomainFromEmailOrThrow('');
} catch (error) {
expect(error).toBeInstanceOf(UserInputError);
expect(error.extensions.code).toBe(ErrorCode.BAD_USER_INPUT);
@@ -27,12 +27,12 @@ describe('getDomainNameByEmail', () => {
});
it('should throw a UserInputError if email does not contain "@"', () => {
- expect(() => getDomainNameByEmail('userexample.com')).toThrow(
+ expect(() => getDomainFromEmailOrThrow('userexample.com')).toThrow(
UserInputError,
);
try {
- getDomainNameByEmail('userexample.com');
+ getDomainFromEmailOrThrow('userexample.com');
} catch (error) {
expect(error).toBeInstanceOf(UserInputError);
expect(error.extensions.code).toBe(ErrorCode.BAD_USER_INPUT);
@@ -42,27 +42,16 @@ describe('getDomainNameByEmail', () => {
}
});
- it('should throw a UserInputError if email has more than one "@"', () => {
- expect(() => getDomainNameByEmail('user@example@com')).toThrow(
- UserInputError,
- );
-
- try {
- getDomainNameByEmail('user@example@com');
- } catch (error) {
- expect(error).toBeInstanceOf(UserInputError);
- expect(error.extensions.code).toBe(ErrorCode.BAD_USER_INPUT);
- expect(error.extensions.userFriendlyMessage.message).toContain(
- 'The provided email address is not valid. Please use a standard email format (e.g., [email protected]).',
- );
- }
+ it('should return the domain after the last "@"', () => {
+ expect(getDomainFromEmailOrThrow('"a@b"@example.com')).toBe('example.com');
+ expect(getDomainFromEmailOrThrow('user@example@com')).toBe('com');
});
it('should throw a UserInputError if domain part is empty', () => {
- expect(() => getDomainNameByEmail('user@')).toThrow(UserInputError);
+ expect(() => getDomainFromEmailOrThrow('user@')).toThrow(UserInputError);
try {
- getDomainNameByEmail('user@');
+ getDomainFromEmailOrThrow('user@');
} catch (error) {
expect(error).toBeInstanceOf(UserInputError);
expect(error.extensions.code).toBe(ErrorCode.BAD_USER_INPUT);
@@ -74,29 +63,35 @@ describe('getDomainNameByEmail', () => {
// Edge cases with weird but potentially valid email formats
it('should handle email with plus addressing', () => {
- expect(getDomainNameByEmail('[email protected]')).toBe('example.com');
+ expect(getDomainFromEmailOrThrow('[email protected]')).toBe(
+ 'example.com',
+ );
});
it('should handle email with dots in local part', () => {
- expect(getDomainNameByEmail('[email protected]')).toBe('example.com');
+ expect(getDomainFromEmailOrThrow('[email protected]')).toBe(
+ 'example.com',
+ );
});
it('should handle email with subdomain', () => {
- expect(getDomainNameByEmail('[email protected]')).toBe(
+ expect(getDomainFromEmailOrThrow('[email protected]')).toBe(
'mail.example.com',
);
});
it('should handle email with numeric domain', () => {
- expect(getDomainNameByEmail('[email protected]')).toBe('123.456.1.2');
+ expect(getDomainFromEmailOrThrow('[email protected]')).toBe('123.456.1.2');
});
it('should handle email with hyphenated domain', () => {
- expect(getDomainNameByEmail('[email protected]')).toBe('my-domain.com');
+ expect(getDomainFromEmailOrThrow('[email protected]')).toBe(
+ 'my-domain.com',
+ );
});
it('should handle email with international domain (punycode)', () => {
- expect(getDomainNameByEmail('[email protected]')).toBe(
+ expect(getDomainFromEmailOrThrow('[email protected]')).toBe(
'xn--nxasmq6b.com',
);
});
@@ -104,19 +99,23 @@ describe('getDomainNameByEmail', () => {
it('should handle email with very long domain', () => {
const longDomain = 'a'.repeat(160) + '.com';
- expect(getDomainNameByEmail(`user@${longDomain}`)).toBe(longDomain);
+ expect(getDomainFromEmailOrThrow(`user@${longDomain}`)).toBe(longDomain);
});
it('should handle email with quoted local part containing spaces', () => {
- expect(getDomainNameByEmail('"user name"@example.com')).toBe('example.com');
+ expect(getDomainFromEmailOrThrow('"user name"@example.com')).toBe(
+ 'example.com',
+ );
});
- it.skip('should handle email with special characters in quoted local part', () => {
- expect(getDomainNameByEmail('"user@#$%"@example.com')).toBe('example.com');
+ it('should handle email with special characters in quoted local part', () => {
+ expect(getDomainFromEmailOrThrow('"user@#$%"@example.com')).toBe(
+ 'example.com',
+ );
});
- it.skip('should handle email with quoted local part containing @', () => {
- expect(getDomainNameByEmail('"user@local"@example.com')).toBe(
+ it('should handle email with quoted local part containing @', () => {
+ expect(getDomainFromEmailOrThrow('"user@local"@example.com')).toBe(
'example.com',
);
});
diff --git a/packages/twenty-server/src/utils/__test__/get-domain-from-email.spec.ts b/packages/twenty-server/src/utils/__test__/get-domain-from-email.spec.ts
new file mode 100644
index 00000000000..f0cb1a9d6b5
--- /dev/null
+++ b/packages/twenty-server/src/utils/__test__/get-domain-from-email.spec.ts
@@ -0,0 +1,29 @@
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
+
+describe('getDomainFromEmail', () => {
+ it('returns the domain of a simple address', () => {
+ expect(getDomainFromEmail('[email protected]')).toBe('example.com');
+ });
+
+ it('returns the domain after the last "@" for a quoted local part', () => {
+ expect(getDomainFromEmail('"a@b"@example.com')).toBe('example.com');
+ });
+
+ it('returns subdomains intact', () => {
+ expect(getDomainFromEmail('[email protected]')).toBe(
+ 'mail.example.com',
+ );
+ });
+
+ it('preserves the original case', () => {
+ expect(getDomainFromEmail('[email protected]')).toBe('Example.COM');
+ });
+
+ it('returns an empty string when the domain part is missing', () => {
+ expect(getDomainFromEmail('user@')).toBe('');
+ });
+
+ it('returns undefined when there is no "@"', () => {
+ expect(getDomainFromEmail('not-an-email')).toBeUndefined();
+ });
+});
diff --git a/packages/twenty-server/src/utils/__test__/is-work-email.spec.ts b/packages/twenty-server/src/utils/__test__/is-work-email.spec.ts
index 9ce57487b43..279dfa94d0b 100644
--- a/packages/twenty-server/src/utils/__test__/is-work-email.spec.ts
+++ b/packages/twenty-server/src/utils/__test__/is-work-email.spec.ts
@@ -14,7 +14,6 @@ describe('isWorkEmail', () => {
});
it('should return false for an email with undefined domain', () => {
- // Assuming getDomainNameByEmail(email) returns undefined if no domain.
expect(isWorkEmail('user@')).toBe(false);
});
diff --git a/packages/twenty-server/src/utils/get-domain-name-by-email.ts b/packages/twenty-server/src/utils/get-domain-from-email-or-throw.ts
similarity index 81%
rename from packages/twenty-server/src/utils/get-domain-name-by-email.ts
rename to packages/twenty-server/src/utils/get-domain-from-email-or-throw.ts
index a4d56bf2f75..632641d8593 100644
--- a/packages/twenty-server/src/utils/get-domain-name-by-email.ts
+++ b/packages/twenty-server/src/utils/get-domain-from-email-or-throw.ts
@@ -2,8 +2,9 @@ import { msg } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { UserInputError } from 'src/engine/core-modules/graphql/utils/graphql-errors.util';
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
-export const getDomainNameByEmail = (email: string) => {
+export const getDomainFromEmailOrThrow = (email: string) => {
if (!isNonEmptyString(email)) {
throw new UserInputError(
'Email is required. Please provide a valid email address.',
@@ -13,9 +14,7 @@ export const getDomainNameByEmail = (email: string) => {
);
}
- const fields = email.split('@');
-
- if (fields.length !== 2) {
+ if (!email.includes('@')) {
throw new UserInputError(
'The provided email address is not valid. Please use a standard email format (e.g., [email protected]).',
{
@@ -24,9 +23,9 @@ export const getDomainNameByEmail = (email: string) => {
);
}
- const domain = fields[1];
+ const domain = getDomainFromEmail(email);
- if (!domain) {
+ if (!isNonEmptyString(domain)) {
throw new UserInputError(
'The provided email address is missing a domain. Please use a standard email format (e.g., [email protected]).',
{
diff --git a/packages/twenty-server/src/utils/get-domain-from-email.ts b/packages/twenty-server/src/utils/get-domain-from-email.ts
new file mode 100644
index 00000000000..4391049da1f
--- /dev/null
+++ b/packages/twenty-server/src/utils/get-domain-from-email.ts
@@ -0,0 +1,9 @@
+export const getDomainFromEmail = (email: string): string | undefined => {
+ const lastAtIndex = email.lastIndexOf('@');
+
+ if (lastAtIndex === -1) {
+ return undefined;
+ }
+
+ return email.slice(lastAtIndex + 1);
+};
diff --git a/packages/twenty-server/src/utils/is-work-email.ts b/packages/twenty-server/src/utils/is-work-email.ts
index e89970a8fed..a13e15f7f10 100644
--- a/packages/twenty-server/src/utils/is-work-email.ts
+++ b/packages/twenty-server/src/utils/is-work-email.ts
@@ -1,12 +1,12 @@
+import { isNonEmptyString } from '@sniptt/guards';
+
import { emailProvidersSet } from 'src/utils/email-providers';
-import { getDomainNameByEmail } from 'src/utils/get-domain-name-by-email';
+import { getDomainFromEmail } from 'src/utils/get-domain-from-email';
export const isWorkEmail = (email: string) => {
- try {
- return !emailProvidersSet.has(getDomainNameByEmail(email));
- } catch {
- return false;
- }
+ const domain = getDomainFromEmail(email);
+
+ return isNonEmptyString(domain) && !emailProvidersSet.has(domain);
};
export const isWorkDomain = (domain: string) => {
diff --git a/packages/twenty-server/test/integration/metadata/suites/emailing/unsubscribe-topic.integration-spec.ts b/packages/twenty-server/test/integration/metadata/suites/emailing/unsubscribe-topic.integration-spec.ts
new file mode 100644
index 00000000000..d9aab57f7dd
--- /dev/null
+++ b/packages/twenty-server/test/integration/metadata/suites/emailing/unsubscribe-topic.integration-spec.ts
@@ -0,0 +1,171 @@
+import { gql } from 'graphql-tag';
+import { makeMetadataAPIRequest } from 'test/integration/metadata/suites/utils/make-metadata-api-request.util';
+import { updateFeatureFlag } from 'test/integration/metadata/suites/utils/update-feature-flag.util';
+import { FeatureFlagKey } from 'twenty-shared/types';
+
+const CREATE_UNSUBSCRIBE_TOPIC = gql`
+ mutation CreateUnsubscribeTopic($input: CreateUnsubscribeTopicInput!) {
+ createUnsubscribeTopic(input: $input) {
+ id
+ name
+ description
+ visibility
+ }
+ }
+`;
+
+const UPDATE_UNSUBSCRIBE_TOPIC = gql`
+ mutation UpdateUnsubscribeTopic($input: UpdateUnsubscribeTopicInput!) {
+ updateUnsubscribeTopic(input: $input) {
+ id
+ name
+ description
+ visibility
+ }
+ }
+`;
+
+const DELETE_UNSUBSCRIBE_TOPIC = gql`
+ mutation DeleteUnsubscribeTopic($id: String!) {
+ deleteUnsubscribeTopic(id: $id)
+ }
+`;
+
+const UNSUBSCRIBE_TOPICS = gql`
+ query UnsubscribeTopics {
+ unsubscribeTopics {
+ id
+ name
+ description
+ visibility
+ }
+ }
+`;
+
+describe('unsubscribeTopicResolver (integration)', () => {
+ const createdTopicIds: string[] = [];
+
+ beforeAll(async () => {
+ await updateFeatureFlag({
+ featureFlag: FeatureFlagKey.IS_EMAIL_GROUP_ENABLED,
+ value: true,
+ expectToFail: false,
+ });
+ });
+
+ afterAll(async () => {
+ await updateFeatureFlag({
+ featureFlag: FeatureFlagKey.IS_EMAIL_GROUP_ENABLED,
+ value: false,
+ expectToFail: false,
+ });
+ });
+
+ afterEach(async () => {
+ for (const id of createdTopicIds) {
+ await testDataSource
+ .query('DELETE FROM core."unsubscribeTopic" WHERE id = $1', [id])
+ .catch(() => {});
+ }
+ createdTopicIds.length = 0;
+ });
+
+ const createTopic = async (input: {
+ name: string;
+ description?: string;
+ visibility?: 'PUBLIC' | 'PRIVATE';
+ }) => {
+ const response = await makeMetadataAPIRequest({
+ query: CREATE_UNSUBSCRIBE_TOPIC,
+ variables: { input },
+ });
+
+ const createdId: string | undefined =
+ response.body.data?.createUnsubscribeTopic?.id;
+
+ if (createdId !== undefined) {
+ createdTopicIds.push(createdId);
+ }
+
+ return response;
+ };
+
+ it('should create a topic and default its visibility to PRIVATE', async () => {
+ const response = await createTopic({ name: 'Product updates' });
+
+ expect(response.status).toBe(200);
+ expect(response.body.errors).toBeUndefined();
+ expect(response.body.data.createUnsubscribeTopic).toMatchObject({
+ name: 'Product updates',
+ description: null,
+ visibility: 'PRIVATE',
+ });
+ expect(response.body.data.createUnsubscribeTopic.id).toBeDefined();
+ });
+
+ it('should persist the topic so it is returned by the list query', async () => {
+ const createResponse = await createTopic({
+ name: 'Newsletter',
+ description: 'Monthly news',
+ visibility: 'PUBLIC',
+ });
+ const createdId = createResponse.body.data.createUnsubscribeTopic.id;
+
+ const listResponse = await makeMetadataAPIRequest({
+ query: UNSUBSCRIBE_TOPICS,
+ });
+
+ expect(listResponse.body.errors).toBeUndefined();
+ expect(
+ listResponse.body.data.unsubscribeTopics.find(
+ (topic: { id: string }) => topic.id === createdId,
+ ),
+ ).toMatchObject({
+ name: 'Newsletter',
+ description: 'Monthly news',
+ visibility: 'PUBLIC',
+ });
+ });
+
+ it('should update an existing topic name and visibility', async () => {
+ const createResponse = await createTopic({ name: 'Draft topic' });
+ const createdId = createResponse.body.data.createUnsubscribeTopic.id;
+
+ const updateResponse = await makeMetadataAPIRequest({
+ query: UPDATE_UNSUBSCRIBE_TOPIC,
+ variables: {
+ input: { id: createdId, name: 'Renamed topic', visibility: 'PUBLIC' },
+ },
+ });
+
+ expect(updateResponse.body.errors).toBeUndefined();
+ expect(updateResponse.body.data.updateUnsubscribeTopic).toMatchObject({
+ id: createdId,
+ name: 'Renamed topic',
+ visibility: 'PUBLIC',
+ });
+ });
+
+ it('should delete a topic so it no longer appears in the list', async () => {
+ const createResponse = await createTopic({ name: 'Temporary topic' });
+ const createdId = createResponse.body.data.createUnsubscribeTopic.id;
+
+ const deleteResponse = await makeMetadataAPIRequest({
+ query: DELETE_UNSUBSCRIBE_TOPIC,
+ variables: { id: createdId },
+ });
+
+ expect(deleteResponse.body.errors).toBeUndefined();
+ expect(deleteResponse.body.data.deleteUnsubscribeTopic).toBe(true);
+
+ const listResponse = await makeMetadataAPIRequest({
+ query: UNSUBSCRIBE_TOPICS,
+ });
+
+ expect(
+ listResponse.body.data.unsubscribeTopics.some(
+ (topic: { id: string }) => topic.id === createdId,
+ ),
+ ).toBe(false);
+ });
+});
diff --git a/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts b/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts
index 6e14e09dbfb..603718f03db 100644
--- a/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts
+++ b/packages/twenty-shared/src/metadata/constants/standard-object.constant.ts
@@ -869,6 +869,145 @@ export const STANDARD_OBJECTS = {
},
},
},
+ messageCampaign: {
+ universalIdentifier: '238acb94-dd4c-4036-bc55-19b99d821efd',
+ fields: {
+ id: { universalIdentifier: '819a9eb4-2738-49df-a302-76d2dc7d7114' },
+ createdAt: {
+ universalIdentifier: '2c7eb5f4-03f8-4101-9486-b2bdf69175d8',
+ },
+ updatedAt: {
+ universalIdentifier: '73c44e3a-9b67-4d1b-887b-d8820cfe6aa5',
+ },
+ deletedAt: {
+ universalIdentifier: 'f7ee084e-7a8e-4b60-a68a-0eb16230589d',
+ },
+ createdBy: {
+ universalIdentifier: 'a75b85d6-12da-4726-9568-3f32f3e3a249',
+ },
+ updatedBy: {
+ universalIdentifier: 'd85c0ce2-5971-4afb-a5b0-e542c7cfda9e',
+ },
+ position: {
+ universalIdentifier: 'ba053d00-e5ef-41ff-9cb1-c87fc9c85081',
+ },
+ searchVector: {
+ universalIdentifier: 'c51f1455-3c56-40b9-80ff-7ffcbdef9609',
+ },
+ subject: { universalIdentifier: '7251544c-b07a-4f0d-9d0a-48514367f230' },
+ bodyTemplate: {
+ universalIdentifier: 'b3a69d08-31ca-4a8d-8359-5ca462899342',
+ },
+ fromAddress: {
+ universalIdentifier: '91e1a33c-c1ff-411a-b720-9085e13c05db',
+ },
+ status: { universalIdentifier: 'c7117256-3de6-48e1-87df-c99c32bad610' },
+ sentAt: { universalIdentifier: 'e2315b4f-9edf-4df2-96b9-961e76368671' },
+ unsubscribeTopicId: {
+ universalIdentifier: '0648e7ad-1769-4ff6-a4d5-72da79ef169c',
+ },
+ list: { universalIdentifier: 'cb24dcdf-f0e8-4c71-8cff-70b714e86530' },
+ timelineActivities: {
+ universalIdentifier: 'd4e5f607-1829-4da3-8eb4-25f607182930',
+ },
+ messages: { universalIdentifier: 'e5a177a7-512b-4778-928e-69777a528f7c' },
+ recipients: {
+ universalIdentifier: '05a3271c-5b91-493c-8f30-2d27b31d019e',
+ },
+ },
+ indexes: {
+ unsubscribeTopicIdIndex: {
+ universalIdentifier: 'efe8c20e-d12b-4475-969e-e86e0bbfe444',
+ },
+ listIdIndex: {
+ universalIdentifier: '17bffd6a-714a-458d-a547-f9e2183d9520',
+ },
+ searchVectorGinIndex: {
+ universalIdentifier: '975823ad-9b97-4f39-b2c7-fbd7d77f4bd1',
+ },
+ },
+ },
+ messageList: {
+ universalIdentifier: '826561ea-4816-411c-baa0-eec5e6ca8866',
+ fields: {
+ id: { universalIdentifier: 'd91c62db-28d1-4e96-83f9-2639dcdcc443' },
+ createdAt: {
+ universalIdentifier: '8cf4126b-135c-4f73-a0c1-a59709274e97',
+ },
+ updatedAt: {
+ universalIdentifier: '78f06ca3-7a5e-4b42-8a18-c8011ae49933',
+ },
+ deletedAt: {
+ universalIdentifier: 'a52447c9-69de-4598-80a7-88fdec58d7f2',
+ },
+ createdBy: {
+ universalIdentifier: '7efc932e-d245-49ef-802a-8f7177278d9a',
+ },
+ updatedBy: {
+ universalIdentifier: '184589db-8fee-4262-b4ee-2ba771a8cdbe',
+ },
+ position: {
+ universalIdentifier: 'e2d4e45d-e510-466f-92e6-d7cea80ea256',
+ },
+ searchVector: {
+ universalIdentifier: '1c6f5064-6e99-4ac9-ac1f-1b8060edf9bc',
+ },
+ name: { universalIdentifier: '69b9ed8b-7b26-4108-894f-05700ef7e8ee' },
+ members: {
+ universalIdentifier: '92df3493-91cf-4665-8587-1b08917d299b',
+ },
+ campaigns: {
+ universalIdentifier: 'e098d838-31ab-4812-91a8-f055f45a6832',
+ },
+ timelineActivities: {
+ universalIdentifier: 'e0a5b2c3-4d6f-4e81-9a02-1b3c4d5e6f70',
+ },
+ },
+ indexes: {
+ searchVectorGinIndex: {
+ universalIdentifier: '8e205171-ed74-4620-b7d2-674aab85033a',
+ },
+ },
+ },
+ messageListMember: {
+ universalIdentifier: '27773d24-8ce3-40f8-aa6c-1f590f2c08d2',
+ fields: {
+ id: { universalIdentifier: '606769a6-1783-4c2b-9e44-1d8389647f7c' },
+ createdAt: {
+ universalIdentifier: '7ae090b9-a48f-435c-aa89-9882f17950a1',
+ },
+ updatedAt: {
+ universalIdentifier: '959473a9-37d6-4708-a0a6-d6b7c6b11907',
+ },
+ deletedAt: {
+ universalIdentifier: '804e56f4-ab42-40dd-bcf5-754d25051daf',
+ },
+ createdBy: {
+ universalIdentifier: '12772bfa-8f0e-411e-a526-b66ef83b34ca',
+ },
+ updatedBy: {
+ universalIdentifier: 'd4586b18-7dd1-43b7-8d26-e58fc8f169f7',
+ },
+ position: {
+ universalIdentifier: '3e169614-c440-4603-bec6-08bbda7c849d',
+ },
+ searchVector: {
+ universalIdentifier: '37f86c8d-6097-4ccd-9f08-027c1d40e9d6',
+ },
+ person: { universalIdentifier: '34288425-8805-42fb-8b98-ee13d09be3d3' },
+ list: {
+ universalIdentifier: 'd5402005-e8f9-4fbe-8696-b6723cd85018',
+ },
+ },
+ indexes: {
+ listIdIndex: {
+ universalIdentifier: '61188470-6dcb-4b2a-b1a9-baeb688bccae',
+ },
+ personListUniqueIndex: {
+ universalIdentifier: 'e5497dc2-1d72-418c-a389-a0645ca0195a',
+ },
+ },
+ },
messageChannelMessageAssociation: {
universalIdentifier: '20202020-ad1e-4127-bccb-d83ae04d2ccb',
fields: {
@@ -1101,6 +1240,9 @@ export const STANDARD_OBJECTS = {
workspaceMember: {
universalIdentifier: '20202020-77a7-4845-99ed-1bcbb478be6f',
},
+ messageCampaign: {
+ universalIdentifier: '5bc768db-919f-41da-8c43-df08084d526f',
+ },
createdBy: {
universalIdentifier: 'e0e6aa04-6ad5-4d12-8799-6febf00452c1',
},
@@ -1124,6 +1266,9 @@ export const STANDARD_OBJECTS = {
workspaceMemberIdIndex: {
universalIdentifier: 'ce1e3a9e-afe9-439d-abb7-6cc98a6fa405',
},
+ messageCampaignIdIndex: {
+ universalIdentifier: 'e9bcdd77-cc8b-4532-833c-124dfdc8e5ff',
+ },
},
views: {
allMessageParticipants: {
@@ -1274,6 +1419,12 @@ export const STANDARD_OBJECTS = {
messageChannelMessageAssociations: {
universalIdentifier: '20202020-3cef-43a3-82c6-50e7cfbc9ae4',
},
+ messageCampaign: {
+ universalIdentifier: '77cff00b-a0ba-48d6-80de-0d5ccf14e45b',
+ },
+ deliveryStatus: {
+ universalIdentifier: '209254fa-2b89-429d-a72a-c401c4bd5a78',
+ },
createdBy: {
universalIdentifier: '6e52bde4-ed41-4462-aa70-121e496270b4',
},
@@ -1291,6 +1442,9 @@ export const STANDARD_OBJECTS = {
messageThreadIdIndex: {
universalIdentifier: '7a05b45e-7aa6-4a7e-9bbc-299cbed53c96',
},
+ messageCampaignIdIndex: {
+ universalIdentifier: '79e777ca-7008-46c5-b3a6-3108b7c7dfb6',
+ },
},
views: {
allMessages: {
@@ -1739,6 +1893,9 @@ export const STANDARD_OBJECTS = {
timelineActivities: {
universalIdentifier: '20202020-a43e-4873-9c23-e522de906ce5',
},
+ listMemberships: {
+ universalIdentifier: '8b8d1be0-4c94-4413-a2c9-c7ede205a81d',
+ },
searchVector: {
universalIdentifier: '57d1d7ad-fa10-44fc-82f3-ad0959ec2534',
},
@@ -2185,6 +2342,12 @@ export const STANDARD_OBJECTS = {
targetDashboard: {
universalIdentifier: '20202020-7864-48f5-af7c-9e4b60140948',
},
+ targetMessageList: {
+ universalIdentifier: 'd9f4a1b2-3c5e-4d70-8e91-0a2b3c4d5e6f',
+ },
+ targetMessageCampaign: {
+ universalIdentifier: 'b2c3d4e5-6f70-4b81-8c92-03d4e5f60718',
+ },
linkedRecordCachedName: {
universalIdentifier: '20202020-cfdb-4bef-bbce-a29f41230934',
},
diff --git a/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts b/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts
index 8966e49bb45..ad1d4669fca 100644
--- a/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts
+++ b/packages/twenty-shared/src/metadata/constants/standard-page-layout-universal-identifiers.constant.ts
@@ -118,6 +118,9 @@ export const STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS = {
pointOfContactForOpportunities: {
universalIdentifier: '20202020-ac02-4002-8002-ae0a1ea11213',
},
+ listMemberships: {
+ universalIdentifier: 'f344eb7d-23c1-457a-a29b-32fd548b6aba',
+ },
},
},
timeline: {
@@ -562,4 +565,42 @@ export const STANDARD_PAGE_LAYOUT_UNIVERSAL_IDENTIFIERS = {
},
},
},
+ messageListRecordPage: {
+ universalIdentifier: 'c1f0a2b3-4d5e-4f60-8a71-9b2c3d4e5f60',
+ tabs: {
+ home: {
+ universalIdentifier: 'c1f0a2b3-4d5e-4f60-8a71-9b2c3d4e5f61',
+ widgets: {
+ fields: {
+ universalIdentifier: 'c1f0a2b3-4d5e-4f60-8a71-9b2c3d4e5f62',
+ },
+ members: {
+ universalIdentifier: 'c1f0a2b3-4d5e-4f60-8a71-9b2c3d4e5f63',
+ },
+ },
+ },
+ },
+ },
+ messageCampaignRecordPage: {
+ universalIdentifier: '8704b091-94bd-4f8f-82b1-e2f3eab92217',
+ tabs: {
+ home: {
+ universalIdentifier: 'f16785cd-a5b7-4ec1-8f20-ff8b80fb94b9',
+ widgets: {
+ fields: {
+ universalIdentifier: '886296e0-a5b6-4054-b450-ad624180c2ef',
+ },
+ messages: {
+ universalIdentifier: 'a33b43f4-72a1-476d-9372-30e82f450377',
+ },
+ recipients: {
+ universalIdentifier: 'b667f20a-1d38-453e-b888-3ecab00a1044',
+ },
+ list: {
+ universalIdentifier: 'b04fb8a5-f471-49a7-b82c-8434ea8276c5',
+ },
+ },
+ },
+ },
+ },
};
diff --git a/packages/twenty-shared/src/types/SettingsPath.ts b/packages/twenty-shared/src/types/SettingsPath.ts
index 0b9d41dd73b..68114f9cc0f 100644
--- a/packages/twenty-shared/src/types/SettingsPath.ts
+++ b/packages/twenty-shared/src/types/SettingsPath.ts
@@ -30,10 +30,10 @@ export enum SettingsPath {
WorkspaceEmail = 'email',
EmailGroupChannelDetail = 'email/email-group/:messageChannelId',
NewEmailGroupChannel = 'email/new-email-group',
+ NewUnsubscribeTopic = 'email/new-unsubscribe-topic',
+ UnsubscribeTopicDetail = 'email/unsubscribe-topic/:unsubscribeTopicId',
PublicDomain = 'applications/public-domain',
NewApprovedAccessDomain = 'security/approved-access-domain/new',
- NewEmailingDomain = 'email/emailing-domain/new',
- EmailingDomainDetail = 'email/emailing-domain/:domainId',
Community = 'community',
AI = 'ai',
AiUsageUserDetail = 'ai/usage/user/:userWorkspaceId',
diff --git a/packages/twenty-shared/src/types/SidePanelPages.ts b/packages/twenty-shared/src/types/SidePanelPages.ts
index f6c9213f968..359a3e3a265 100644
--- a/packages/twenty-shared/src/types/SidePanelPages.ts
+++ b/packages/twenty-shared/src/types/SidePanelPages.ts
@@ -28,4 +28,5 @@ export enum SidePanelPages {
CommandMenuEdit = 'command-menu-edit',
PageLayoutRecordPageWidgetTypeSelect = 'page-layout-record-page-widget-type-select',
ComposeEmail = 'compose-email',
+ ComposeCampaign = 'compose-campaign',
}