Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello, It seems like MailChimp has added marketing_permissions to its API. Are we going to be able to add this field to our forms soon?

    Thread Starter mayw

    (@mayw)

    Yes, that works. Thank you so much for taking the time to answer.

    Thread Starter mayw

    (@mayw)

    Thanks for the answer and the link. ok, well I am a developer but not a PHP developper. Doing this on the side for someone. I am starting out simple, just seeing if I can get see the changes in MailChimp. I have added two filters but only the one sending over the WEBSITE is working. Can I have these in two seperate add_filter() or do I need to combine them into one? Or is there another reason why the grouping isn’t working.

    /*
     * Add groupings to MailChimp
     */
    add_filter( 'mc4wp_integration_woocommerce_merge_vars', function( $vars ) {
       if( ! isset( $vars['GROUPINGS'] ) ) {
          $vars['GROUPINGS'] = array();
       }
       $grouping = array(
          'id' => xxxxxx,
          'groups' => array( 'un client' )
       );
       $vars['GROUPINGS'][] = $grouping;
       return $vars;
    });
    
    /*
     * Add extra fields to MailChimp
     */
    add_filter( 'mc4wp_integration_woocommerce_merge_vars', function( $merge_vars ) { 
    
    	// Grab MailChimp field values from the current request
    	$merge_vars['WEBSITE'] = sanitize_text_field( 'axxxxxxia.fr' ); 	
    
    	// Return the fields so the plugin knows to send them to MailChimp
    	return $merge_vars;
    });
Viewing 3 replies - 1 through 3 (of 3 total)