Author Topic: get Agent name  (Read 15587 times)

0 Members and 1 Guest are viewing this topic.

moj0

  • Jr. Member
  • **
  • Posts: 2
get Agent name
« on: January 29, 2010, 11:48:26 AM »
hi guys i want to add a agent name in my predefinedanswers (Canned Messages) how can i do that?

sihouse

  • Jr. Member
  • **
  • Posts: 1
Re: get Agent name
« Reply #1 on: March 22, 2010, 08:44:06 PM »
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: [Select]
foreach($canned_messages as $answer) {
   $predefinedres .= "<option>".htmlspecialchars(topage($answer['vcvalue']))."</option>";
}

4.  Change $predefinedres to the following:

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

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!