• Resolved johnohod

    (@johnohod)


    I’ve added a filter to sync only users that exists in a database table. It looks like this:

    add_filter( 'mailchimp_sync_should_sync_user', function( $subscribe, $user ) 
    {
       $brukerid = $user->ID;
       $klasse = $wpdb->get_row( "SELECT * FROM klasser WHERE wpuserid='$brukerid'" );
       if( null !== $klasse ) 
       {
          return true;
       } 
       else 
       {
          return false;
       }
       
    });

    But the list in Mailchimp is still empty. I’ve tried manual sync, and debug looks like this for each user:
    09:25:23Updating #995 4trinn <[email protected]>
    09:25:23Error: null

    Does Error: null, mean that there is an error?

    • This topic was modified 8 years, 9 months ago by johnohod.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Lap

    (@lapzor)

    Yes, that seems like an “unknown error”.

    You can check the API log on the MailChimp.com side and see if there is a more specific message there?

    MailChimp.com > Click on your username, Account > Extras > API keys. Scroll down to see the API log for the past 24 hours.

    I noticed the ticket is marked as resolved, did you find the solution?

    Thanks for letting us know,

    Thread Starter johnohod

    (@johnohod)

    I forgot to add “global $wpdb;” in the function. A bit embarrassing…

    Plugin Contributor Lap

    (@lapzor)

    The number of hours I wasted in my life on just a missing semicolon or a misplaced comma…. 😉

    Thanks for letting us know how you solved it.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Users not syncing with list. Wrong in filter?’ is closed to new replies.