• Resolved kees78

    (@kees78)


    Hi I have a similar problem. Based on your link to the wiki, i have the following function added:

    
    function custom_mailchimp_sync_user_mergetags($merge_vars, $user) {
    	$merge_vars['TROUWDATUM'] = 'tryout';
    
    	return $merge_vars;
    
    }
    add_filter('mailchimp_sync_user_mergetags', 'custom_mailchimp_sync_user_mergetags', 100, 2);

    In the log, i see the information is not sended .

    However, when i change the function to:

    function custom_mailchimp_sync_user_mergetags($merge_fields, $user) {
    	/// add anything you would like to this array - and return it
    	$merge_fields['TROUWDATUM'] = 'tryout';
    
    	return $merge_fields;
    
    }
    add_filter('mailchimp_sync_user_mergetags', 'custom_mailchimp_sync_user_mergetags', 10, 2);

    The information is sended, i see in the logs.

    but then the information is not imported in mailchimp. I created a custom field in mailchimp with “Trouwdatum” and for testing purposes set it on text.

    What is going wrong here?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ryanhungate

    (@ryanhungate)

    @kees78 can you please make sure the merge tag is spelled exactly the same as the one you put into Mailchimp? Case sensitive.

    Thread Starter kees78

    (@kees78)

    Ok thank you, i understand now that you have to use the mergetag, in my case “MMERGE5”. It just worked, which is great.

    Then the next problem is: how can i get this working for guest orders?

    Plugin Author ryanhungate

    (@ryanhungate)

    @kees78 as of today – version 2.4.1 does not allow this because the customer was transactional only.

    However, the next release 2.4.2 will include a new filter for mailchimp_get_ecommerce_merge_tags which you’ll be able to do exactly what you’re asking.

    The documentation will be updated in our wiki to show you exactly how to do this just like the user merge tags as soon as the code is released, and we will make sure to ping you here once it’s released. We’re just finishing up QA and the release notes so stay tuned for that next!

    Thread Starter kees78

    (@kees78)

    ok thank you!

    Plugin Author ryanhungate

    (@ryanhungate)

    @kees78 2.4.3 has been pushed up today and you should be able to accomplish this by updating the plugin – and then adding a custom function like this.

    Please test this in a local or staging environment before pushing to production to be sure you’re getting the desired results on the merge tags.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘custom fields not syncing’ is closed to new replies.