CF7 MailChimp Integration
Contact form7 mailchimp integration
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/onjoma/cf7-mailchimp-integration/archive/refs/heads/main.zipA powerful WordPress plugin that seamlessly integrates Contact Form 7 with MailChimp, allowing you to automatically add form submissions to your MailChimp lists/audiences.
📋 Table of Contents
- Features
- Requirements
- Installation
- Getting Your MailChimp API Key
- Configuration
- Field Mapping
- Interest Groups
- Tags
- Logging
- Troubleshooting
- Documentation
- Contributing
- Support
- License
Features
- Easy API Integration - Simple setup with your MailChimp API key
- Flexible Field Mapping - Map Contact Form 7 fields to MailChimp merge fields
- Interest Groups Support - Subscribe users to specific interest groups
- Tag Management - Automatically tag subscribers
- Multiple Forms - Configure different MailChimp lists for different forms
- Email Suppression - Option to disable CF7 emails and send only to MailChimp
- Activity Logging - Track all submissions with detailed logs
- User-Friendly Interface - Intuitive admin panel for easy configuration
- Auto-Detection - Automatically detects server prefix from API key
- Error Handling - Comprehensive error logging and reporting
Requirements
- WordPress 5.0 or higher
- PHP 7.2 or higher
- Contact Form 7 plugin installed and activated
- MailChimp account with API access
Installation
- Upload the
cf7-mailchimp-integrationfolder to the/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Go to CF7 MailChimp in the WordPress admin menu
- Enter your MailChimp API Key and save settings
Getting Your MailChimp API Key
- Log in to your MailChimp account
- Go to Account → Extras → API Keys
- Create a new API key or copy an existing one
- The API key format looks like:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us1
Configuration
Step 1: Configure API Settings
- Navigate to CF7 MailChimp → Settings
- Enter your MailChimp API Key
- The server prefix (e.g., us1, us2) will be auto-detected
- Enable logging if you want to track submissions
- Click Test Connection to verify your settings
- Save settings
Step 2: Map Form Fields
- Navigate to CF7 MailChimp → Form Mappings
- Select a Contact Form 7 form to configure
- Choose the MailChimp list/audience
- Select the email field from your form
- Map additional fields (First Name, Last Name, etc.)
- Configure interest groups if needed
- Add tags (optional, comma-separated)
- Enable the integration
- Save mapping
Step 3: Test Your Form
- Submit a test entry through your Contact Form 7 form
- Check your MailChimp list to verify the subscriber was added
- Review logs in CF7 MailChimp → Logs for any errors
Field Mapping
The plugin supports mapping Contact Form 7 fields to MailChimp merge fields:
Standard MailChimp Fields
- EMAIL - Email address (required)
- FNAME - First name
- LNAME - Last name
- PHONE - Phone number
- ADDRESS - Address
- BIRTHDAY - Birthday
- Custom merge fields you've created in MailChimp
Example Contact Form 7 Setup
<label> Your Name
[text* your-name] </label>
<label> Your Email
[email* your-email] </label>
<label> Phone
[tel your-phone] </label>
[submit "Subscribe"]
Example Field Mapping
- MailChimp
EMAIL→ CF7your-email - MailChimp
FNAME→ CF7your-name - MailChimp
PHONE→ CF7your-phone
Interest Groups
Interest groups allow you to segment your subscribers. To use interest groups:
- Create interest groups in your MailChimp list
- Add checkbox or radio fields to your Contact Form 7
- Map these fields to the corresponding interest groups in the plugin
Example:
<label> Interests
[checkbox interests "Newsletter" "Product Updates" "Events"] </label>
Tags
You can automatically tag subscribers by entering comma-separated tags in the mapping configuration:
newsletter, website-signup, 2024
Tags help you organize and segment your audience in MailChimp.
Logging
Enable logging to track all submissions:
- Go to CF7 MailChimp → Settings
- Check "Enable Logging"
- Save settings
- View logs at CF7 MailChimp → Logs
Logs include:
- Form name
- Email address
- Status (success/error)
- Error messages
- Timestamp
Troubleshooting
Connection Test Fails
- Verify your API key is correct
- Check that the server prefix matches your API key
- Ensure your server can make outbound HTTPS requests
- Check for firewall or security plugin restrictions
Subscribers Not Being Added
- Verify the integration is enabled for the form
- Check that the email field is correctly mapped
- Review logs for error messages
- Ensure the email address is valid
- Check MailChimp list settings (double opt-in, etc.)
Field Mapping Not Saving
- Clear your browser cache
- Check for JavaScript errors in browser console
- Verify you have proper WordPress permissions
- Ensure Contact Form 7 is up to date
Hooks and Filters
For Developers
The plugin provides hooks for customization:
Actions
// Before subscribing to MailChimp
do_action('cf7mc_before_subscribe', $form_id, $email, $data);
// After successful subscription
do_action('cf7mc_after_subscribe', $form_id, $email, $response);
// After failed subscription
do_action('cf7mc_subscribe_failed', $form_id, $email, $error);
Filters
// Modify merge fields before sending
$merge_fields = apply_filters('cf7mc_merge_fields', $merge_fields, $form_id);
// Modify tags before sending
$tags = apply_filters('cf7mc_tags', $tags, $form_id);
// Modify subscriber status
$status = apply_filters('cf7mc_subscriber_status', 'subscribed', $form_id);
Privacy & GDPR
This plugin sends form data to MailChimp. Ensure you:
- Have proper consent checkboxes in your forms
- Include privacy policy links
- Inform users their data will be sent to MailChimp
- Comply with GDPR and other privacy regulations
Example consent field:
[acceptance acceptance-privacy] I agree to receive emails and my data being stored by MailChimp [/acceptance]
📖 Documentation
- Quick Start Guide - Get started in 5 minutes
- Installation Guide - Detailed installation instructions
- Plugin Summary - Technical architecture overview
- Changelog - Version history and updates
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
🐛 Bug Reports
If you discover any bugs, please create an issue on GitHub with:
- Detailed description of the issue
- Steps to reproduce
- Expected vs actual behavior
- WordPress version, PHP version, and plugin version
- Error logs (if available)
💬 Support
For support:
- Check the documentation
- Review the Quick Start Guide
- Check existing GitHub Issues
- Create a new issue if needed
📝 Changelog
See CHANGELOG.md for detailed version history.
Version 1.0.0 (2024-11-23)
- ✅ Initial release
- ✅ MailChimp API v3.0 integration
- ✅ Field mapping interface
- ✅ Interest groups support
- ✅ Tag management
- ✅ Activity logging with database storage
- ✅ Multi-form support
- ✅ Email notification suppression option
- ✅ Comprehensive admin interface
👨💻 Author
LindaWP
- Website: https://lindawp.com
- GitHub: @yourusername
📄 License
This project is licensed under the GPL v2 or later - see the LICENSE file for details.
🙏 Acknowledgments
- Built for the WordPress community
- Powered by MailChimp API v3.0
- Integrates seamlessly with Contact Form 7
📸 Screenshots
- Settings page with API configuration
- Form mappings interface with status indicators
- Field mapping with MailChimp merge fields
- Interest groups configuration
- Activity logs dashboard with filtering
Made with ❤️ by LindaWP