Mailchimp for WordPress can subscribe people to your Mailchimp audience when they submit a Contact Form 7 form. You can add an optional newsletter checkbox, or use a hidden field if every form submission should be subscribed.
Before you start, make sure you have:
- Installed and activated Mailchimp for WordPress.
- Connected Mailchimp for WordPress to your Mailchimp account.
- Installed and activated Contact Form 7.
- Enabled the Contact Form 7 integration and selected at least one Mailchimp audience under MC4WP > Integrations > Contact Form 7.
Add a Mailchimp checkbox to Contact Form 7
To let visitors choose whether they want to subscribe, add this shortcode to your Contact Form 7 form:
[mc4wp_checkbox "Subscribe to our newsletter"]
Mailchimp for WordPress will replace this shortcode with a newsletter sign-up checkbox.
Example Contact Form 7 form
The following example shows a basic Contact Form 7 contact form with a Mailchimp newsletter checkbox.
<p>
<label>Your name<br />
[text* your-name]</label>
</p>
<p>
<label>Your email<br />
[email* your-email]</label>
</p>
<p>
<label>Your message<br />
[textarea your-message]</label>
</p>
<p>
[mc4wp_checkbox "Subscribe to our newsletter"]
</p>
<p>
[submit "Send"]
</p>
When someone submits this form and checks the box, Mailchimp for WordPress will look for the submitted email address and name. It will then subscribe the person to the Mailchimp audience selected in MC4WP > Integrations > Contact Form 7.
Subscribe every Contact Form 7 submission
If every person who submits the form should be subscribed to Mailchimp, use a hidden field instead of a checkbox:
<input type="hidden" name="mc4wp-subscribe" value="1" />
Only use this if your form text clearly explains that submitting the form also subscribes the person to your newsletter.
Send extra Contact Form 7 fields to Mailchimp
By default, Mailchimp for WordPress detects common fields such as email and name. If your Mailchimp audience requires extra fields, add those fields to Contact Form 7 with the mc4wp- prefix.
For example, if your Mailchimp field is called COMPANY, use:
[text mc4wp-COMPANY]
The part after mc4wp- must match the exact Mailchimp field name.
For a full example, see sending additional Contact Form 7 fields to Mailchimp.
Show the Mailchimp checkbox in Contact Form 7 emails
To include the checkbox value in the email sent by Contact Form 7, add this mail tag to your Contact Form 7 email template:
<p>
Wants to receive newsletter: [mc4wp_checkbox]
</p>
Troubleshooting
If Contact Form 7 submissions are not added to Mailchimp, check the following:
- The Contact Form 7 integration is enabled under MC4WP > Integrations > Contact Form 7.
- At least one Mailchimp audience is selected.
- Your Contact Form 7 form includes either
[mc4wp_checkbox]or the hiddenmc4wp-subscribefield. - The submitted form contains a valid email field.
- Required Mailchimp fields are present in the form.
- The Mailchimp for WordPress debug log does not show an error from Mailchimp.
If you use different Contact Form 7 forms for different audiences, see using different Mailchimp audiences for different Contact Form 7 forms.
For general Mailchimp API errors, see fixing the “Oops. Something went wrong” error.