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.