Skip to main content

Overview

Constant Contact is widely used by real estate firms for organizing developer launches, property expos, and high-volume subscriber newsletters. In BrokerOS, the Constant Contact integration lives in integrations/mail/constant-contact/src/index.ts under the Turborepo workspace package @brokeros/int-mail-constant-contact. BrokerOS administrators configure Constant Contact accounts through the Web UI at Dashboard -> Marketing -> Email -> Settings. Tokens are encrypted using AES-256-GCM and stored in PostgreSQL (MarketingIntegration).

Architecture and Dispatch Sequence

The Constant Contact integration implements the IEmailMarketingProvider contract from @brokeros/types.

Step 1: Obtain Credentials from Constant Contact

  1. Log into the Constant Contact Developer Portal.
  2. Navigate to My Applications and create a new application.
  3. Copy your API Key (Client ID) and App Secret.
  4. Generate an authorization code and exchange it for an offline Refresh Token with contact_data and campaign_data permissions.
  5. In your Constant Contact account settings, verify your corporate sending email address.

Step 2: Connect in the BrokerOS Web Dashboard

In your BrokerOS dashboard:
  1. Navigate to Dashboard -> Marketing -> Email -> Settings.
  2. Open the Providers & Domains tab (/dashboard/marketing/email/settings?tab=providers).
  3. Click Add Provider and select Constant Contact.
  4. Fill in the modal connection fields:
  1. Click Verify & Connect. BrokerOS tests token renewal against Constant Contact’s token endpoint and validates account status via GET https://api.cc.email/v3/account/summary. Once confirmed, credentials are encrypted via AES-256-GCM and stored in MarketingIntegration.

Step 3: Configure Webhook Delivery Destination

To capture delivery events and unsubscribes:
  1. In Constant Contact, set your webhook URL to:
  2. Subscribe to events for Delivered, Opened, Clicked, Bounced, and Unsubscribed.
  3. Save changes. Incoming events are routed through ConstantContactWebhookParser to update lead engagement.

Integration Implementation Details

The integration logic is located in integrations/mail/constant-contact/src/index.ts.

OAuth Token Refresh

The client exchanges its refresh token against the Constant Contact token authority before executing API requests: