• Resolved popos93

    (@popos93)


    Hi,

    I just installed your plugin and it works as a charm. Thank you for your contribution.

    1. Currently, my site is assigning the registration email as the user’s username, but users registering through your plugin receive a username generated from their Facebook first and last name. Is it possible to change this and simply make the plugin set the Facebook email address as their username? I found the piece of code that does this in your plugin, but I am not knowledgeable enough in PHP to modify it myself.

    2. I noticed that users registering through your plugin receive a welcome email with their username and other info. I am using a different plugin that sends these emails to customers and your plugin seems to send some emails I did not design.

    Thank you

    • This topic was modified 4 years ago by popos93.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Laszlo

    (@laszloszalvak)

    Hi @popos93

    1.) We indeed try to generate a unique username from the first name and last name, when it is possible. But if you would like to rather use the email address then you will need to do some custom coding that we can not provide support for.
    Also I don’t really recommend using the email as username if a user registers with social login, since nothing can guarantee that the provider will return an email address.
    For example Facebook gives the user an option to hide their email address, and if the person decides to hide it, then you won’t be able to generate a username using the email address. So you will either need to stick to the way we generate the usernames, or find out another solution.

    But if you still want to generate the username from the email, then in our documentation you can find an example of how you can use the “nsl_registration_user_data” filter to override user data before the registration

    If the provider returned the email address, then it should be available in the first parameter of the nsl_registration_user_data filter. For example if you var_dump it in the filter like:

    add_filter('nsl_registration_user_data', function($userData, $provider){
        echo "<pre>";
        var_dump($userData);exit;
    
        return $userData;
    },10,2);

    then it would display the email and the generated username inside the $userData variable as an array e.g.:

    array(2) {
      ["email"]=>
      string(32) "[email protected]"
      ["username"]=>
      string(10) "exampleusername"
    }

    so basically you could get the email address like: $userData[’email’] and you could override the value of the username with it.
    If the email address is empty, then the user probably didn’t grant access to see his/her Facebook email address.

    2.) Nextend Social Login registers the users the same way as WordPress does, so that notification is not sent by us but by WordPress. This also means that, if you customize the WordPress default registration notification that will also affect to the emails sent when the user registers with social login.
    There are also some plugins which are capable of overriding the WordPress default notifications, e.g.: Better Notifications for WP – https://www.ads-software.com/plugins/bnfw/
    so feel free to give it a try.

    Best regards,
    Laszlo.

    • This reply was modified 4 years ago by Laszlo.
    Thread Starter popos93

    (@popos93)

    Thank you for your reply.

    Regarding the email customization, I am actually using Kadence WooCommerce Email Designer, but your plugin seems to use some other email template. I can’t understand where it gets it from because it does not look like the Woocommerce default emails nor like Kadence emails.

    Thank you

    Plugin Support Laszlo

    (@laszloszalvak)

    Hi @popos93

    The default registration notification of WordPress looks something like this:

    Username: testuser
    To set your password, visit the following address:
    https://example.com/wp-login.php?action=rp&key=Ty86qpA52IBDN3B9H6XF&login=testuser
    https://example.com/wp-login.php

    with no fancy styling.

    If you see a different message, then I think something already overrides the default WordPress registration notifications. If you check the format and the links of the email, you can probably find out what sends customized message.
    If there is nothing in the email that helps in recognizing the plugin, then you can find it with a plugin/theme conflict test.
    So you should disable all plugins except Nextend Social Login and change your theme to a WordPress default one, like Twenty Twenty. Then check the registration with social login. If it sends the WordPress default email that I mentioned above, then you could start enabling the plugins one by one or in small groups and check the registration with social login again. Once you receive the custom email, then you managed to find the plugin that is responsible.

    If you managed to find it, then please let me know its name and I will take a look.

    • This reply was modified 4 years ago by Laszlo.
    Thread Starter popos93

    (@popos93)

    You’re right, Nextend sends the default WordPress email template. However, my customers receive a different template from the “Kadence email plugin”, but it seems that your plugin does not use that, it uses the default WordPress emails.

    Is there another email template plugin that you recommend I should use in order to fix this issue?

    Thread Starter popos93

    (@popos93)

    If I check the email template in Woocoomerce settings, it looks like the template from Kadence plugin, which I am currently using. However, Nexend seems to send out the default WordPress template without any customization.

    • This reply was modified 4 years ago by popos93.
    Plugin Support Laszlo

    (@laszloszalvak)

    Hi @popos93!

    I checked “Kadence WooCommerce Email Designer” on my local test site and as I see it overrides the WooCommerce default registration notifications, but it don’t have any effect on the WordPress default registration notifications. So users registered with the WordPress default login form at the /wp-login.php page and users registered with social login will still receive the default notifications.

    The good news is that, in the Pro Addon we have an integration for the WooCommerce registration notifications, so there registrations with social login could send the customized WooCommerce registration notifications of “Kadence WooCommerce Email Designer”. However this forum is for the Free version only.
    So if you have additional questions related to Pro features, then please rather open a support ticket here:

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Set facebook email as site username’ is closed to new replies.