feat(messaging): webhook push sync for Gmail, Calendar and Microsoft (#21970)

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/21970?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
neo773
2026-06-23 14:04:16 +05:30
committed by GitHub
parent 84f4ac9082
commit 9e31ffdf68
51 changed files with 2079 additions and 6 deletions
@@ -47,6 +47,7 @@ import { MessageQueueModule } from 'src/engine/core-modules/message-queue/messag
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/modules/messaging-webhooks/messaging-webhooks.module';
import { ConnectedAccountSyncWebhooksModule } from 'src/modules/connected-account-sync-webhooks/connected-account-sync-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';
@@ -88,6 +89,7 @@ import { FileModule } from './file/file.module';
BillingModule,
BillingWebhookModule,
MessagingWebhooksModule,
ConnectedAccountSyncWebhooksModule,
UsageModule,
ClientConfigModule,
FeatureFlagModule,
@@ -28,6 +28,14 @@ export const PUBLIC_FEATURE_FLAGS: PublicFeatureFlag[] = [
'Show the per-page hero illustration + video walkthrough modal on settings pages',
},
},
{
key: FeatureFlagKey.IS_MESSAGING_CALENDAR_WEBHOOK_ENABLED,
metadata: {
label: 'Messaging & Calendar Webhooks',
description:
'Sync Gmail, Google Calendar, and Microsoft 365 mail/calendar via provider push notifications instead of cron polling',
},
},
...(process.env.CLOUDFLARE_API_KEY
? [
// {
@@ -177,6 +177,29 @@ export class ConfigVariables {
})
MESSAGING_PROVIDER_GMAIL_ENABLED = false;
@ConfigVariablesMetadata({
group: ConfigVariablesGroup.GOOGLE_AUTH,
isSensitive: false,
description:
'Google Cloud Pub/Sub topic that Gmail push notifications publish to ' +
'(format: projects/<project>/topics/<topic>). Required for webhook-based Gmail sync.',
type: ConfigVariableType.STRING,
})
@IsOptional()
MESSAGING_GMAIL_PUBSUB_TOPIC: string;
@ConfigVariablesMetadata({
group: ConfigVariablesGroup.GOOGLE_AUTH,
isSensitive: false,
description:
'Service account email authorized to deliver Gmail Pub/Sub push ' +
'notifications. The signed OIDC token on each push is verified against ' +
'this email. Required for webhook-based Gmail sync.',
type: ConfigVariableType.STRING,
})
@IsOptional()
MESSAGING_GMAIL_PUBSUB_VERIFICATION_EMAIL: string;
@ConfigVariablesMetadata({
group: ConfigVariablesGroup.ADVANCED_SETTINGS,
description: 'Enable or disable the IMAP messaging integration',