# Best practices to integrate with salesforce

**URL:** <https://forum.mautic.org/t/best-practices-to-integrate-with-salesforce/31254>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [March 13, 2024, 1:10pm UTC](https://forum.mautic.org/t/best-practices-to-integrate-with-salesforce/31254 "2024-03-13T13:10:49Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![markwilliams21](https://avatars.discourse-cdn.com/v4/letter/m/3be4f8/32.png) [@markwilliams21](https://forum.mautic.org/u/markwilliams21)\
**Post date:** [June 6, 2024, 12:30pm UTC](https://forum.mautic.org/t/best-practices-to-integrate-with-salesforce/31254/4 "2024-06-06T12:30:07Z")

</div>

> [@integration](#):
>
> My Mautic version is: 4.4  
> My PHP version is: 7.4  
> My Database type and version is: MySQL
> 
> Currently, I’ve authorized mautic with my sandbox instance, and in the features tab it’s mentioned to pull the contacts/push contacts from salesforce CRM. But none of the contacts pulled to mautic instance.
> 
> 1. How can we pull required accounts with contacts from Salesforce?( If that’s not possible, how can you pull everything?)
> 2. How can we set up a two-way sync, so that if someone responds with “Do not Contact” in the email replies or updates a new field change in the CRM, it reflects in Mautic?
> 3. How does the sync cycle happen? Is it every 5 minutes or some other period?
> 4. How can you push activity information, such as after sending an email to a contact, if the contact responds to the email?
> 
> If someone already achieved this. Please provide some guidance, it would be really helpfull

To integrate Mautic with Salesforce and set up a two-way sync, there are several steps and configurations required. Here’s a comprehensive guide to achieve this:

### 1. **Authorize Salesforce in Mautic:**

1. **Navigate to the Plugin Configuration:**

2. **Authorize Salesforce:**

### 2. **Configure Contact Sync:**

1. **Setup Fields Mapping:**

2. **Sync Settings:**

### 3. **Pull Contacts and Accounts from Salesforce:**

1. **Set Filters (If needed):**

2. **Initiate Sync:**

### 4. **Set Up Two-Way Sync:**

1. **Configuration in Mautic:**

2. **Salesforce Workflow Rules:**

### 5. **Sync Cycle:**

1. **Schedule Cron Jobs:**

### 6. **Push Activity Information:**

1. **Activity Sync:**
  - Ensure that you have mapped the appropriate activity fields in the Salesforce plugin configuration in Mautic.
  - Set up cron jobs for pushing activity data as shown above.

### 7. **Troubleshooting and Guidance:**

- **Check Mautic Logs:**

- **Salesforce Integration Community:**

### 8. **Example Configuration:**

1. **Mautic to Salesforce Field Mapping:**

2. **Cron Job Example:**

### Conclusion:

By following the above steps, you should be able to set up a two-way sync between Mautic and [Salesforce](https://www.janbasktraining.com/online-salesforce-training), pull required accounts and contacts, and ensure that updates such as “Do not Contact” are reflected in both systems. The sync cycle can be customized with cron jobs to meet your specific needs. If you encounter any issues, reviewing the logs and community resources can provide additional support.

---

_[View the full topic](https://forum.mautic.org/t/best-practices-to-integrate-with-salesforce/31254)._
