Add Mailchimp interest choice to Contact Form 7 forms

If you are using a sign-up checkbox in your Contact Form 7 forms you sometimes want to give a choice to sign up to different interest groups.

The easiest way to do this is by first generating the code for Interest groups in the Form builder under MC4WP > Forms > Fields. When you click the button above the form builder with the name of your interest group you can choose between Dropdown, Radio buttons or Checkboxes. Depending on your choice the code looks a bit different. Then copy the generated HTML to your Contact Form 7 form. Another way to get the ID number for your interest groups is by clicking on your list name under MC4WP > Mailchimp. You can not copy the ID numbers from any other place! The ID numbers you may see in the URL bar in your Mailchimp.com account are not the same ID numbers and won’t work for this purpose.

Now all that is left is adding the mc4wp- prefix to the name attribute, so our plugin knows to send the value of that field to your selected Mailchimp list.

<select name="mc4wp-INTERESTS[ec75a797c8]">
	<option value="5527b34480">Interest group 1</option>
	<option value="462b888077">Interest group 2</option>
</select>

If you went with checkboxes you have to add the mc4wp- prefix to each individual “name” attribute.

<input name="mc4wp-INTERESTS[ec75a797c8][]" type="checkbox" value="5527b34480" /> Interest group 1<br />
<input name="mc4wp-INTERESTS[ec75a797c8][]" type="checkbox" value="462b888077" /> Interest group 2<br />

You can also hide the choice (make it implicit) by changing the type from “checkbox” to “hidden”.

<input name="mc4wp-INTERESTS[ec75a797c8][]" type="hidden" value="5527b34480" />

The code in the examples above are purely illustrative. Make sure to generate the code with your own interestgroup names and id’s via MC4WP > Forms > Fields.

If interest groups that you recently created in Mailchimp are not showing in the form builder yet, go to MC4WP > Mailchimp and click the “Renew Lists” button.