> ## Documentation Index
> Fetch the complete documentation index at: https://memberpulseptyltd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce

> CRM synchronization for member and organization data

## Overview

Salesforce integration enables bi-directional synchronization of member data, activities, and organizations between MemberPulse and Salesforce CRM.

## Features

| Feature              | Description                               |
| -------------------- | ----------------------------------------- |
| Contact Sync         | Bi-directional contact synchronization    |
| Activity Tracking    | Log member activities in Salesforce       |
| Campaign Integration | Trigger campaigns based on member actions |
| Lead Scoring         | Enrich leads with membership data         |
| Custom Objects       | Map to custom Salesforce objects          |

## Configuration

### Prerequisites

1. Salesforce account with API access
2. Connected App configured in Salesforce
3. OAuth2 credentials

#### Acceptance Criteria

##### Frontend

* [ ] Prerequisites workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Prerequisites as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

### Environment Variables

```bash theme={null}
SALESFORCE_CLIENT_ID=xxxxxxxxxxxx
SALESFORCE_CLIENT_SECRET=xxxxxxxxxxxx
SALESFORCE_LOGIN_URL=https://login.salesforce.com
```

#### Acceptance Criteria

##### Frontend

* [ ] Environment Variables workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Environment Variables as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

### Platform Settings

Navigate to **Client Portal > Settings > Integrations > Salesforce**

| Setting         | Type   | Required | Description                      |
| --------------- | ------ | -------- | -------------------------------- |
| Environment     | Select | Yes      | Production or Sandbox            |
| Consumer Key    | Text   | Yes      | Connected app consumer key       |
| Consumer Secret | Secret | Yes      | Connected app consumer secret    |
| Auto-sync       | Toggle | No       | Enable automatic synchronization |

#### Acceptance Criteria

##### Frontend

* [ ] Platform Settings workflow is implemented in the UI as described.

##### Backend / API

* [ ] Backend behavior supports Platform Settings as documented.

##### Permissions

* [ ] Access is restricted per the Capabilities matrix on this page (or equivalent role rules).

##### Business Rules

* [ ] All business rules for this feature are enforced.

##### Error Handling

* [ ] Error states return clear messages and appropriate HTTP status codes.

## Field Mapping

| MemberPulse Field | Salesforce Field |
| ----------------- | ---------------- |
| Email             | Email            |
| First Name        | FirstName        |
| Last Name         | LastName         |
| Phone             | Phone            |
| Company           | Account.Name     |
| Membership Status | Custom field     |

## Tagging & Automation (Predefined Tags)

MemberPulse emits a small, **hardcoded** set of tags to keep Salesforce automation predictable.

* Tag catalog: [`CRM Tag`](/entities/integration/crm-tag)
* Sync log/audit trail: [`CRM Sync Record`](/entities/integration/crm-sync-record)

Typical flows:

* **Membership**: apply membership status tags (active/expiring/expired, upgraded, downgrade scheduled)
* **Events**: apply **pre-event** tag on registration and **post-event** tags on attendance/no-show
* **Courses**: apply tag on enrollment and completion

How tags map into Salesforce:

* Tags can be written to a multi-select picklist on Contact, a related custom object, or campaign membership (implementation choice).

## Support Ticket Notes

When enabled, support ticket activity is logged back to the Contact as a note/task:

* Minimum payload: ticket number + status + link back to MemberPulse

## Troubleshooting

For Salesforce integration issues, see the [Admin Troubleshooting Guide](/admin/salesforce-troubleshooting).

#### Acceptance Criteria

##### Frontend

* [ ] UI provides configuration controls and status/health indicators for this integration.

##### Backend / API

* [ ] Integration can be connected, configured, and exercised end-to-end (auth + sync/webhooks).

##### Permissions

* [ ] Only `ROLE_CLIENT_ADMIN` (or equivalent) can configure the integration.

##### Business Rules

* [ ] Data sync respects tenant isolation and mapping rules.

##### Error Handling

* [ ] Auth and sync failures are surfaced with actionable messages and retry behavior.
