Livechat: Additional info (custom field) after the username
Rocket.Chat Version: 0.56.0 Running Instances: 1 DB Replicaset OpLog: activated Node Version: v 4.8.2.
Hi there, I've activated live chat and it works great. I'am using the queue feature. Here is my question:
If a customer wants to write to the live chat he can register with username and e-mail address. I'am using a custom field for the customer number which an agent can see on the information tab.
Is it somehow possible to show the custom field after the username of the customer in the queue (ex. Peter Miller 076)? So our agents would be able to see the customer number before starting to chat. This is useful because every agent has a limited number of customers he is responsible for. If the agent sees that he is not responsible for the customer, he can ignore the message and the agent which is responsible can take over.
I already thought about a custom script in layout options but I did not get far with that. Another thing I tried was using onPrechatFormSubmit from the livechat api. I thought I could add the customerno to the username before submitting the data. That did not work. I think the form data is submitted before the onPrechatFormSubmit event is called.
I hope I could make clear what my use case is. :)
Greetings
Stefan
This feature would be great!
Hi @puetzstef! We are improving the Livechat API and we are adding new methods, as you can see here: #10918. One of these methods is to allow you to set / change the visitor's name so you can do what you are looking for. Please follow the Pull Request review process to know when this feature will be available. Thanks.
Hi @puetzstef!
I didn't get any reply from you, are you still tracking this issue?
As you can see at here: https://rocket.chat/docs/developer-guides/livechat-api/#set-name-field
We can rely on setGuestName method:
RocketChat(function() {
this.setGuestName('visitor name');
});
So, using this method, we can concatenate the customer name + customer number, what do you think?
Wouldn't it works on your case?
Any feedback would be very appreciated. Thanks.