Contributions > Plugins, tips, and tricks

get Agent name

(1/1)

moj0:
hi guys i want to add a agent name in my predefinedanswers (Canned Messages) how can i do that?

sihouse:
I needed the same, here's how I did it:

1.  Edit the file webim/libs/chat.php in your favourite editor

2.  Find the function setup_chatview_for_operator

3.  Find the foreach loop that looks like this:


--- Code: ---foreach($canned_messages as $answer) {
   $predefinedres .= "<option>".htmlspecialchars(topage($answer['vcvalue']))."</option>";
}
--- End code ---

4.  Change $predefinedres to the following:


--- Code: ---$predefinedres .= "<option>".htmlspecialchars(topage(
    preg_replace("/{operator_name}/", $operator['vccommonname'], $answer['vcvalue'])
))."</option>";

--- End code ---

5.  Login to webim as administrator, and add a canned message like the following:

Hello, my name is {operator_name}, how may I be of assistance today.

{operator_name} will automatically become your operator name whenever you start a new chat with a client.

Hope this helps!

Navigation

[0] Message Index

Go to full version