• saraelba

    (@saraelba)


    Hello!

    Fields [BPHONE] [BADDRESS1] [BADDRESS2] [BCITY] and [BZIPCODE] are not been sent to mailchimp.

    All these Merge Fields are already created in Mailchimp as TEXT fields.

    Here is the recipe:

    function my_pmpro_mailchimp_listsubscribe_fields( $fields, $user ) 
    
    {
    	$new_fields =  array(
    		
    		"BPHONE" => $user->bphone,
    		"BADDRESS1" => $user->baddress1,
    		"BADDRESS2" => $user->baddress2,
    		"BCITY" => $user->bcity,
    		"BZIPCODE" => $user->bzipcode,
                        
    		/**
     * and others
     */
    		
    		);
    	$fields = array_merge( $fields, $new_fields );
    	  
    	return $fields;
    }
    
    add_action( 'pmpro_mailchimp_listsubscribe_fields', 'my_pmpro_mailchimp_listsubscribe_fields', 10, 2 );
    
    /**
     * Tell PMPro MailChimp to always synchronize user profile updates. By default it only synchronizes if the user's email has changed (optional).
     * Requires PMPro Mailchimp v2.0.3 or higher.
     */
    add_filter( 'pmpromc_profile_update', '__return_true' );

    I had add a new member. This is the log file:

    -------------
    Logged On: 03/25/2021 18:41:13
    Processing update for audience AUNDIENCENAME (n894759839): Array
    (
        [0] => stdClass Object
            (
                [email_address] => useremailhere@email
                [status] => subscribed
                [merge_fields] => Array
                    (
                        [FNAME] => TestName
                        [LNAME] => TestLastname
                        [BPHONE] => 
                        [BADDRESS1] => 
                        [BADDRESS2] => 
                        [BZIPCODE] => 
     	            [BCITY] => 
                        [BCOUNTRY] => ES
                        [BSTATE] => Islas Baleares
                        [PMPLEVELID] => 1
                        [PMPALLIDS] => {1}
                        [PMPLEVEL] => Cuota de socio anual
                    )
    
            )
    
    )
    
    -------------
    Logged On: 03/25/2021 18:41:15
    Mailchimp Response: No errors detected.
    -------------

    Thanks for your help 🙂

  • The topic ‘Not sending Billing information to Mailchimp’ is closed to new replies.