• Resolved s976

    (@s976)


    Hi, it’s a great plugin!
    The problem is that I have two different newsletters, and I want to make two forms for subscribing…
    Is it possible? (I can not find how to figure it out)
    Also it can be good if a plugin was have a feature to display a few check boxes, so that the visitors could choose witch newsletter they will be subscribed…

    https://www.ads-software.com/plugins/mailchimp-for-wp/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hi there,

    Sorry, in the lite version you can only create one form. In the premium version of the plugin you can easily create as many forms as you like, each form subscribing to one or multiple of your MailChimp lists.

    The checkboxes is something that you can add by adding a few lines of code to your theme its functions.php file. It is not included in the plugin because MailChimp uses interest groupings to segment a list.

    I’m not sure how comfortable you are adding code to your functions.php file but if you want to have the user choose which list to subscribe to, you can do that as follows.

    1. Add the following HTML to your form mark-up, in the form settings of the plugin.

    <p>
      Lists:
    
      <input type="checkbox" name="lists[]" value="f123456" /> List 1
      <input type="checkbox" name="lists[]" value="f123456" /> List 2
    </p>

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

    function my_mc4wp_lists($lists) {
    
      if(isset($_POST['lists'])) {
        $lists = $_POST['lists'];
      }
    
      return $lists;
    }
    
    add_filter('mc4wp_lists', 'my_mc4wp_lists');

    I’ve simplified the HTML a little, the important part is the value attribute which should match the ID of your MailChimp list(s).

    The complete code can be found here.

    Hope that helps!

    Thread Starter s976

    (@s976)

    Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple forms’ is closed to new replies.