WP Manifestindependent plugin directory
manifest / integrations / cf7-mailchimp-integration

CF7 MailChimp Integration

Contact form7 mailchimp integration

by LindaWP · github.com/onjoma/cf7-mailchimp-integration · website

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/onjoma/cf7-mailchimp-integration/archive/refs/heads/main.zip

A powerful WordPress plugin that seamlessly integrates Contact Form 7 with MailChimp, allowing you to automatically add form submissions to your MailChimp lists/audiences.

CF7 MailChimp Integration

📋 Table of Contents

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

  1. Upload the cf7-mailchimp-integration folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Go to CF7 MailChimp in the WordPress admin menu
  4. Enter your MailChimp API Key and save settings

Getting Your MailChimp API Key

  1. Log in to your MailChimp account
  2. Go to Account → Extras → API Keys
  3. Create a new API key or copy an existing one
  4. The API key format looks like: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us1

Configuration

Step 1: Configure API Settings

  1. Navigate to CF7 MailChimp → Settings
  2. Enter your MailChimp API Key
  3. The server prefix (e.g., us1, us2) will be auto-detected
  4. Enable logging if you want to track submissions
  5. Click Test Connection to verify your settings
  6. Save settings

Step 2: Map Form Fields

  1. Navigate to CF7 MailChimp → Form Mappings
  2. Select a Contact Form 7 form to configure
  3. Choose the MailChimp list/audience
  4. Select the email field from your form
  5. Map additional fields (First Name, Last Name, etc.)
  6. Configure interest groups if needed
  7. Add tags (optional, comma-separated)
  8. Enable the integration
  9. Save mapping

Step 3: Test Your Form

  1. Submit a test entry through your Contact Form 7 form
  2. Check your MailChimp list to verify the subscriber was added
  3. 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 → CF7 your-email
  • MailChimp FNAME → CF7 your-name
  • MailChimp PHONE → CF7 your-phone

Interest Groups

Interest groups allow you to segment your subscribers. To use interest groups:

  1. Create interest groups in your MailChimp list
  2. Add checkbox or radio fields to your Contact Form 7
  3. 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:

  1. Go to CF7 MailChimp → Settings
  2. Check "Enable Logging"
  3. Save settings
  4. 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:

  1. Have proper consent checkboxes in your forms
  2. Include privacy policy links
  3. Inform users their data will be sent to MailChimp
  4. 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

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. 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:

  1. Check the documentation
  2. Review the Quick Start Guide
  3. Check existing GitHub Issues
  4. 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

📄 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

  1. Settings page with API configuration
  2. Form mappings interface with status indicators
  3. Field mapping with MailChimp merge fields
  4. Interest groups configuration
  5. Activity logs dashboard with filtering

Made with ❤️ by LindaWP