Don't see an email address when I bring back the "emails" identity from FaceBook

Hello
I see an array in the field when I try to bring back the emails identity
It looks like this : a:1:{i:0;O:8:
Can some help?
Thanks

Best Answers

  • Fred_PinelFred_PinelMember
    edited January 2016 Answer ✓
    Hi,
    The emails attribute is an array of email objects, it gets serialized (serialize()) by WP (update_user_meta()) when stored in the database.
    So, what you are reporting looks in fact correct, if you looking at the table directly.

    Hope this helps.
  • Fred_PinelFred_PinelMember
    Answer ✓
    Hi,
    Nevertheless, you can still access the email. You just need to deserialize it.

    Regards.

Answers

  • Hi,
    The logs show that the last Facebook profiles you requested had a valid email address.
    The message you show look like some data format problem.

    What's the code you use to access the emails list? (or a brief description of your environment if you don't want to post code)

    Regards
  • Thanks for your feedback Frederic
    I used this function call:

    //Handle data retrieved from a social network profile
    function oa_social_login_store_extended_data ($user_data, $identity)
    {
    // $user_data is an object that represents the newly added user
    // The format is similar to the data returned by $user_data = get_userdata ($user_id);

    // $identity is an object that contains the full social network profile

    //Example to store the gender
    update_user_meta ($user_data->id, 'paypal_email', $identity->emails);
    }

    //This action is called whenever Social Login adds a new user
    add_action ('oa_social_login_action_after_user_insert', 'oa_social_login_store_extended_data', 10,


    The user_meta field type is Varchar(255)
    My intent is to eventually capture the user's email address from PaypPal only because I am using it in a delayed payment procedure

    Thanks for your help

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.