Support » Plugin: MailChimp User Sync » sync subscriber meta key and value

  • Resolved mke09

    (@mke09)



    I am using restrict content pro and I have 4 subscription level. 3 of them i want to add the members manually via the restrict content pro.
    Can i add filter to add only my 3 subscribers?

    meta_key="rcp_subscription_level" meta_value="2"
    meta_key="rcp_subscription_level" meta_value="3"
    meta_key="rcp_subscription_level" meta_value="4"

    I am assuming that this is the correct filter?
    I am unsure how to add ‘rcp_subscription_level’ – can anyone please advise:

    add_filter( 'mailchimp_sync_should_sync_user', function( $subscribe, $user ) {
    
        // check for custom user field
        if( $user->subscribe_me ) {
            return true;
        }
    
        // do not subscribe otherwise
        return false;
    });

    thanks Michael

    https://wordpress.org/plugins/mailchimp-sync/

Viewing 1 replies (of 1 total)
  • Plugin Author Ibericode

    (@ibericode)

    Hi Michael,

    If your subscription level ID’s in RCP are “2”, “3” and “4” then the following code should do the trick.

    add_filter( 'mailchimp_sync_should_sync_user', function( $should, $user ) {
         if( ! $should ) {
            return false;
        }
    
        $subscription_id = rcp_get_subscription_id( $user->ID );
        $should = in_array( $subscription_id, array( 2, 3, 4 ) );
    
        return $should;
    }, 10, 2 );

    Hope that helps. If not, let me know!

Viewing 1 replies (of 1 total)
  • The topic ‘sync subscriber meta key and value’ is closed to new replies.