Mibew Messenger Community

General => Support => Topic started by: Infoserv on September 26, 2018, 12:59:05 PM

Title: Configuration Visitor name
Post by: Infoserv on September 26, 2018, 12:59:05 PM
Hello,

I need some help to configure the "visitor name"
 for it to be pre-registered at customer connexion.

thank you for you help
Title: Re: Configuration Visitor name
Post by: faf on September 26, 2018, 04:19:03 PM
What exactly are you trying to do?

Don't hesitate to provide maximum details. Only that way one could be able to understand your question.
Title: Re: Configuration Visitor name
Post by: stryker1 on October 13, 2018, 01:51:26 PM
I guess he also wants the same as I:
I want to integrate Mibew in an existing web application where the user is logged in, so I already know is name.

I want to directly start the chat, without the first step that the user has to enter his name (again).

Is there a way to start the chat without asking for the username, or even better: start the chat with the name of the user? Maybe include the name as parameter in the event the chat button fires when opening the Mibew chat window?
Title: Re: Configuration Visitor name
Post by: faf on October 13, 2018, 10:00:57 PM
I guess he also wants the same as I:

Could you borrow me your crystal ball? Mine seems broken.  ;D

I want to integrate Mibew in an existing web application where the user is logged in, so I already know is name.

I want to directly start the chat, without the first step that the user has to enter his name (again).

Is there a way to start the chat without asking for the username, or even better: start the chat with the name of the user? Maybe include the name as parameter in the event the chat button fires when opening the Mibew chat window?

You can start the chat without asking for anything. Just disable the option "Pre-chat survey".

As of predefined visitor name, there are two possible ways:

1. The right (and complicated) one is to create a plugin that will make use of \Mibew\EventDispatcher\Events::VISITOR_TRACK and \Mibew\EventDispatcher\Events::THREAD_CREATE events. See docs here (https://docs.mibew.org/development/server-side-events.html#visitor-events) and here (https://docs.mibew.org/development/server-side-events.html#thread-events) for more details.

 2. The tricky (and not recommended) one is to manually alter the code of the button.

 One have to replace:

Code: [Select]
Mibew.ChatPopup.init({"id":"<some unique id>","url":"\/mibew\/chat?locale=en"
with

Code: [Select]
Mibew.ChatPopup.init({"id":"<some unique id>","url":"\/mibew\/chat?locale=en&name=<the desired visitor name>"
In that case the default name in the form will be equal to the desired value. But it's a kind of hack, so use at your own risk.
Title: Re: Configuration Visitor name
Post by: stryker1 on October 14, 2018, 11:51:05 AM
Quote
2. The tricky (and not recommended) one is to manually alter the code of the button.
This is working great :) Thank you!