Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Full Name from integration #101

Open
Frisoni opened this issue Apr 4, 2018 · 7 comments
Open

Incorrect Full Name from integration #101

Frisoni opened this issue Apr 4, 2018 · 7 comments

Comments

@Frisoni
Copy link

Frisoni commented Apr 4, 2018

Plugin uses wp_user->display_name to fill user Name in intercom. But, display name can modified and not always is set as "John Doe". Sometimes display_name uses the first part of user email which causes to set name as john_doe_17, for example.

Suggestion is to use wordpress_user->user_firstname." ".wordpress_user->user_lastname instead os display_name.

@lkraav
Copy link
Contributor

lkraav commented Apr 5, 2018

Whatever the case, result should be filterable to do whatever is needed.

As a matter of fact, the settings output array might already be filterable, so you could override. @Frisoni have you checked?

@Frisoni
Copy link
Author

Frisoni commented Apr 5, 2018

Yes, I have know set name correctly with filter, but as an easy to go plugin most customers won't be able to customize using code.
I have a lot of incorrect user names in Intercom until I discovered what was going on.

@lkraav
Copy link
Contributor

lkraav commented Apr 5, 2018

You might have a point - the default should perhaps be not the Display Name.

@GRSM78
Copy link

GRSM78 commented May 3, 2018

@Frisoni Would you mind sharing the filter?
@lkraav Any timeline for a fix?

@lkraav
Copy link
Contributor

lkraav commented May 4, 2018

It's not really up to me to decide defaults on this project.

@Frisoni
Copy link
Author

Frisoni commented May 7, 2018

@GRSM78 This is the filter to use, BUT it doesn`t work every time. :(
add_filter( 'intercom_settings', function( $settings ) {
$current_user = wp_get_current_user();
if($current_user->id !== 0){
$settings['name'] = ...; // add specific logic to specify the name
}
return $settings;
} );

@GRSM78
Copy link

GRSM78 commented May 7, 2018

Have you tried to include a priority? Maybe the reason why it's not working every time is that the original filter is being triggered as well (but later), overwriting yours?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants