MailChimp for WordPress
[resolved] Subscribe to specific list (Contact Form 7) (6 posts)

  1. RobinWebber
    Posted 2 years ago #

    Hi there,

    I have multiple contact forms on my website in different languages. Therefore I would like users to subscribe to a specific list inside my Mailchimp account for the selected language. I'm using Contact Form 7. Could someone tell me how this is possible?



  2. Danny van Kooten
    Plugin Author

    Posted 2 years ago #

    Hi Robin,

    So you want your Contact Form 7 subscribers to be subscribed to a different list than the one you have selected in MailChimp for WP > Checkboxes?

    There are various filters and actions for you to hook into but it would require some coding knowledge. Are you comfortable adding stuff to your theme its functions.php file?

  3. RobinWebber
    Posted 2 years ago #

    Hi Danny,

    I think that's what I try to do indeed. Well, let's say I have 4 different lists: 1 for English subscribers, 1 for French subscribers, 1 for German subscribers and 1 for Italian subscribers. I also have 4 different contact forms in the 4 different languages, one contact form in English, one in French etc.

    How can I let somebody subscribe to the English MailChimp list from the English contact form, but subscribe to the French MailChimp list from the French contact form?

    I know how to code so I would be able to add stuff to functions.php.

    Thanks again!

  4. Danny van Kooten
    Plugin Author

    Posted 2 years ago #

    Hi Robin,

    I just answered your email but posting the required steps here as well, in case others stumble across this topic when trying to accomplish the same thing.

    1. Add the list ID to your Contact Form 7 form mark-up (in a hidden input field).

    <input type="hidden" name="_mc4wp_list" value="123abc1234" />

    2. Add the following filter to your theme its functions.php file.

    function myprefix_mc4wp_lists( $lists ) {
    	if( isset( $_POST['_mc4wp_list'] ) ) {
    		$lists = array( $_POST['_mc4wp_list'] );
    	return $lists;
    add_filter( 'mc4wp_lists', 'myprefix_mc4wp_lists' );

    You can find the List ID in your MailChimp list settings.

    Hope that helps!

  5. RobinWebber
    Posted 2 years ago #

    Hi Danny,

    It works! Great :) Thanks for your help!

  6. leeqin1022
    Posted 2 years ago #

    Hi Danny and Robin,

    Here is my form

    I wish visitors subscribed (Email and Name) to a specific mailchimp list after they have submitted the FORM.

    Should I follow the same procedures as well?

    I'm not a coding guy, but I can try follow the exact solution.

    But I'm not clear about the the procedures no.1 written as "in a hidden input field"

    Thanks :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • MailChimp for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic