Skip to content

Send a lead form to Salesforce and Mautic

In this tutorial you build a small lead form and connect it to Salesforce and Mautic. Every submission creates a Contact in Salesforce and is passed to a Mautic form. At the end you test the form and check the result on the entry.

You need CampaignSuite connected to Salesforce and Mautic (see Installation), and a Mautic form that accepts at least an email address. Use sandboxes while you practise.

  1. In WordPress go to Forms > New Form and give the form a title, for example “Lead form”.
  2. Add these fields: Name (first and last name), Email, Phone and a Checkboxes field with one choice, “Keep me informed by email”.
  3. Make Name and Email required and save the form.

The lead form in the form editor with name, email, phone, a newsletter checkbox and a hidden Salesforce Contact ID field

The form in the screenshot also has a hidden field Salesforce Contact ID. You don’t need it for this tutorial. It’s used to update contacts you already know (see Prefill).

  1. Open the form and go to Settings > CS | Feeds, then click Add New.
  2. Enter a Feed name, for example “Salesforce contact”.
  3. Choose Feed type SF | Create or update.
  4. Choose Feed moment When entry is created. The feed then runs right after the submission is saved.

General feed settings: name, the type SF | Create or update and the moment When entry is created

  1. Under Create or Update Settings choose the Object Contact.
  2. Under Map your form fields to the object fields add a row for each field: First Name from Name (First), Last Name from Name (Last), Email from Email and Business Phone from Phone.
  3. To store where the contact came from, add a row Lead Source and type a fixed value such as Website as the value (choose Add Custom Value).
  4. Click Save Settings.

The Contact object with form fields mapped to First Name, Last Name, Email, Phone and Lead Source

  1. Click Add New again and enter the Feed name, for example “Mautic form”.
  2. Choose Feed type MTC | Form Submit and again Feed moment When entry is created.
  3. Under Mautic Settings choose the Form in Mautic.
  4. Map the Mautic form fields: for example Email (Alias: email) from Email and First Name (Alias: first_name) from Name (First).
  5. Click Save Settings.

Mautic feed settings with the Mautic form chosen and two fields mapped

Both feeds now show in the feed list.

The feed list with the Salesforce and the Mautic feed

  • When entry is created is the usual choice, and the one used here.
  • Before confirmation works the same way, but runs just before the visitor sees the confirmation.
  • By hand sends nothing until you run the feed from an entry.
  • The FinDock moments are only for forms with payments. They send data after a payment event.
  1. Put the form on a page with the Gravity Forms block, or use Preview in the form editor.
  2. Fill in the form with fictional data, such as “Fenna Demoveld” and [email protected], and submit it.

The lead form on a page

  1. Go to Forms > Entries, choose your form and open the new entry.
  2. Look at the Feed Action Details box. Each feed shows its Result. For Salesforce that’s a link to the new Contact, for Mautic a message that the form was submitted.

Feed Action Details on the entry: the Mautic feed succeeded and the Salesforce feed shows the ID of the new Contact

If a feed shows Error, the notes on the entry tell you why. Common causes are a required Salesforce field that is not mapped, or a Salesforce duplicate rule that blocks a contact that already exists. After fixing the feed you can run it again with the Execute Feed Actions box on the entry.

You can also open the record in Salesforce and the submission in Mautic to see the data arrive.

  • To send only people who ticked the checkbox, add a Feed Condition to the Mautic feed.
  • To update known contacts instead of creating new ones, see Prefill and Feeds.
  • To collect donations, see Fields and FinDock payments.