Subscribe visitors to a Mailchimp list with Formidable for your Mailchimp signup form. When a form is submitted, automatically add or auto update subscriber information. Please note, you must have a Mailchimp account in order to use the Mailchimp add-on.
Download and install
- If you haven't already, install and activate the current version of Formidable Forms Premium on your WordPress site.
- After confirming your Formidable Forms license, proceed to the Formidable → Add-Ons page and click the Install button for the Mailchimp WordPress plugin.
Set up a Mailchimp signup form
Now that the Mailchimp plugin is activated you’ll need to set up a Mailchimp signup form. Follow the steps below to integrate Formidable Forms with your Mailchimp account.
How to get Mailchimp API key
- Now that the plugin is activated, go to Formidable → Global Settings → Mailchimp.
- Insert your Mailchimp API Key.
You can find your API key by logging into your Mailchimp account, and going to Account → Extras → API Keys. Click 'Create A Key' if you don't have one set up already.
Form settings
- Go into the form which you will be using to subscribe users to a mailing list. Click on Settings → Actions & Notifications → Mailchimp.
- Select the Mailchimp list that you would like to add subscribers to. Select the Email Address, and any other required options. The options that show up here are determined in your Mailchimp list's settings.
- Trigger this action when: Select 'Create' if you would like the user to be added to the mailing list when they submit the form. Select 'Create' and 'Update' if you would like to update the user's details in the mailing list when his/her entry is updated.
- Tags: Add a comma-separated list of tags to include on the subscriber. Learn more about how to add tags to a subscriber.
- Opt in: If you would like to add the user's email address to the mailing list automatically, select 'Single'. Select 'Double' if you would like the user to confirm their subscription prior to being added to the mailing list.
- Conditional logic can be used to add a user to the mailing list only if specific conditions are met. Please note that Conditional Logic is only available in the Pro version of Formidable Forms.
Note: Mailchimp will not add email addresses that look fake (such as john@example.com) to a mailing list.
Set up a group field
- Set up a group on your Mailchimp account.
- Once you have set up a group in Mailchimp, go into your form and add a field for the group. If you don't want this field to be seen, you can select a default value and set the field visibility to administrator.
- Go to your form Settings → Actions & Notifications → Mailchimp.
- Select the Mailchimp list that you would like to use to add subscribers. Select the Email Address and any other required options. If your Mailchimp group was set up correctly, it will appear as an option. In this example, the group is 'Signup Source'. Match up the group with the field that you created in Step 2. Select the field value that should cause the subscriber to be added to each group. Every option in the group does not have to be selected.
- Click update.
Related reading: How to Let Users Select Mailchimp Groups in WordPress Forms
Add tags to a subscriber
After your Mailchimp form action is set up, you will see a Tags option. This field accepts values from a field, or any tags typed directly into the setting. When adding multiple tags, separate each one with a comma. A few examples of valid tags include:
- lead,from website
- [25],[26]
- [25],lead
Set up a mailing address
Mailchimp has a few specialized types of fields that can be added to each list. An address field is one of these optional fields. To send an address from a contact form to Mailchimp, follow these steps:
- Set up an Address field in your Mailchimp list. Follow the steps here to do that.
- Go to the build page for your Formidable form. Click the Address field.
- Go to your form Settings → Actions & Notifications and open your Mailchimp action. If you have not created one, you may create a Mailchimp action now.
- Map the Address option in the Mailchimp action to the Address field in your form.
- Click update.
Set up a phone number field
If you would like to pass a phone number from a Formidable form to Mailchimp, please follow the instructions below.
- Set up a Phone field in your Mailchimp list. Follow the steps here to do that.
- Once you have set up a Phone Number field in your Mailchimp list, go into your form and add a Phone Number field. If you selected (999)999-999 for the phone format in Mailchimp, put 999-999-9999 in the Format box. If you selected International for the phone format in Mailchimp, you may use any format in the Phone Number field.
- Go to your form Settings → Actions & Notifications and open your Mailchimp action. If you have not created one, you may create a Mailchimp action now.
- Map the Phone option in the Mailchimp action to the Phone Number field in your form.
- Click update.
Unsubscribing a user
If you would like to create a form where users could unsubscribe from your Mailchimp mailing list, please follow the instruction below.
- Create a form and add an email address field. You could build an unsubscribe survey.
- Go to your form Settings → Actions & Notifications and select the Mailchimp icon.
- In the Add to Mailchimp form action, set the Action to Unsubscribe address.
Mailchimp GDPR marketing
To set up your forms to stay compliant with the GDPR, follow the steps below to enable GDPR fields in Mailchimp.
- Log into your Mailchimp account and go to Audience → Audience Dashboard → Manage Audience → Settings. Click the GDPR Fields and Settings.
- Select the Enable GDPR fields on Signup Forms checkbox.
- By default, it will show the Marketing preferences options for Email, Direct Email, and Customized Online Advertising. For more details on setting up your GDRP fields, please see Mailchimp’s documentation.
- Go to your form Settings → Actions & Notifications → Mailchimp form action and select a Mailchimp list.
- Select a field in the Marketing Preferences dropdown to display the options. There must be a Contact in the selected list before the settings show in the form action.
Read more: How to Use the Mailchimp GDPR Marketing Options
Additional customizations
Pass email type preference
If you want users to select their email type preference (either HTML or plain-text), you must first add a field to your form where the user can select 'HTML' or 'Plain-text'. In the field's options, select 'Use separate values'. In the 'Saved Value' column, insert 'html' for the 'HTML' option and 'text' for the 'Plain-text' option.
add_filter( 'frm_mlcmp_subscribe_data', 'frm_pass_email_type_preference', 10, 2 );
function frm_pass_email_type_preference( $sending_data, $entry ){
if ( $entry->form_id == 12 ) {
$sending_data['email_type'] = $entry->metas[150];
}
return $sending_data;
}
Replace 12 with the ID of your form. Replace 150 with the ID of the field where the email type is selected.
Limitations
When creating Mailchimp custom fields with the Address field type, we recommend setting the form field as required. If the user didn't fill out the full address details (i.e., Line 1 or Line 2 is left blank), Mailchimp ignores the entire address data.
Troubleshooting
Subscribers are not added
After you set up your form action with the instructions above, new subscribers should be added to your Mailchimp list. If they are not, start with these steps.
- Mailchimp will not add email addresses that look fake (such as john@example.com) to a mailing list. Are you trying a real email address that has not been used as a subscriber in this account?
- Often the best first step is to install the Formidable Logs add-on to get more details about any errors that might be preventing your data from getting to Mailchimp.
- Turn on double opt-in in the Mailchimp signup form action settings. Then submit the form with an email address you have never used before with Mailchimp. If you receive the email, you should be good to go and new subscribers will be added. Check your spam email too if you don't see it.
- If you do not receive the email, check the conditional logic settings in your form action. If you have conditional logic there, remove it and submit the form again. If you receive the email, adjust your conditional logic to trigger the subscription at the correct time.
Mailchimp API.cURL error 28
If you see the "Mailchimp API.cURL error 28: Operation timed out" error message, it usually means that the Mailchimp API is timing out before retrieving your lists. You can fix this issue by increasing the WordPress HTTP request timeout, which defaults to 5. Add the following code to the WPCode plugin.
add_filter( 'http_request_timeout', 'frm_custom_timeout_extender' ); function frm_custom_timeout_extender( $time ) { return 30; }
Registered user not receiving email
When an email address is added to the list multiple times, Mailchimp treats it as a duplicate so the email won't be sent again. Learn more about how Mailchimp handles duplicates.