• Resolved sitemanagerjin

    (@sitemanagerjin)


    After activating the wp user integration add on, newsletter successfully adds the existing as well as new wp users to the subscriber list, if they create their account using WordPress. But users won’t be added to subscriber list if they are registered using some social login plugin, like miniorange Social Login or Nextend Social Login.

    i have tested it using various other social login plugins, but it fails every time.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter sitemanagerjin

    (@sitemanagerjin)

    Also in case it isn’t possible, do tell me about the code snippets that i could use in my child theme function.php, where i could add a hook to add user to the newsletter. i have drafted the rough code, but i am blank on how to generate newsletter instance in my theme. if there is a possibility to add some hook or filter, do update.

    $newsletter = Newsletter::instance();
    $user = $newsletter->get_user_by_wp_user_id($user->id);
    $email =$user->user_email;
    $subscriber = $newsletter->get_user($email, ARRAY_A);
    if ($subscriber == null) {
        $subscriber = array();
        $subscriber['email'] = $email;
        $newsletter->save_user($subscriber);
    }
    Plugin Author Stefano Lissa

    (@satollo)

    If, if the social login plugin when it creates a user, invokes the standard WP functions, the user creation can be intercepted with our free “wp users” addon.

    Alternatively your code is almost ok, just remove this line

    $user = $newsletter->get_user_by_wp_user_id($user->id);

    since it returns a subscriber (internally for historic reasons the subscriber is called “user”). It seems you already have the WP user in the $user variable.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Incompatible with social login’ is closed to new replies.