Author Topic: Sending Unique Values From User Button To Chat Operator  (Read 17764 times)

0 Members and 1 Guest are viewing this topic.

psychotron

  • Full Member
  • ***
  • Posts: 7
Sending Unique Values From User Button To Chat Operator
« on: February 02, 2009, 07:21:55 PM »
I have a few unique values on an ASP page that I would like to send to the operator when the chat is initiated.  I would start by putting the ASP values into the button code, like this (postal code in this example)...

/webim/client.php?locale=en&post_code=<%=(post_code)%>

So this should get a value post_code to client.php, but how do I get the value of post_code into my email message (offline), or to the chat operator (online).  Our operators need this information from the user, and since it is on the page already, I really hate to ask them to provide it to us again.

Please advise...


psychotron

  • Full Member
  • ***
  • Posts: 7
Re: Sending Unique Values From User Button To Chat Operator
« Reply #1 on: February 06, 2009, 02:49:52 PM »
Anyone?  This package is great and I would love to implement it on my site, but it would be a lot better if I could pass information from the customer to our support people automatically.  It would make a huge difference.

Eddybaur

  • Native
  • *****
  • Posts: 237
  • Mibew Member
    • Mibew
Re: Sending Unique Values From User Button To Chat Operator
« Reply #2 on: February 07, 2009, 02:44:15 AM »
i'd respond sooner, but i'm a little confused. Basically you want to have your ASP code to send to a specific operator? And about the email, i'm lost there...

Inspirer

  • Mibew Project founder
  • Native
  • *****
  • Posts: 262
    • Mibew Messenger
Re: Sending Unique Values From User Button To Chat Operator
« Reply #3 on: February 07, 2009, 12:56:07 PM »
First of all, add info parameter into button code in two places:

<!-- webim button --><a href="/webim/client.php?locale=en&info=aaaaaa" target="_blank" onclick="if(navigator.userAgent.toLowerCase().indexOf('opera') != -1 && window.event.preventDefault) window.event.preventDefault();this.newWindow = window.open('/webim/client.php?locale=en&info=aaaaaa',......

Apply the patch (attached).

Results:

In the chat (second message is visible only for operators):
14:16:48 Thank you for contacting us. An operator will be with you shortly...
14:16:48 Info: rrraaabbb

In mail:
.....
His email: mail@mail.com
Info: rrraaabbb

Evgeny.

psychotron

  • Full Member
  • ***
  • Posts: 7
Re: Sending Unique Values From User Button To Chat Operator
« Reply #4 on: February 09, 2009, 06:38:05 PM »
Hi Inspirer

Yes this is exactly what I want to do.  I want to send extra values to the chat operator that answers, or the extra values across in an email message should the chat operator not be available.  Our pricing is regional and I want to send the customer's post code, which they already provide before entering our product catalogue.  Thanks for the patch.  I will give it a try and post back to the thread if I need further help.

Cheers!

psychotron

  • Full Member
  • ***
  • Posts: 7
Re: Sending Unique Values From User Button To Chat Operator
« Reply #5 on: February 09, 2009, 09:19:19 PM »
Used your example in the patch with "info" string, and went full tilt adding the 5 different values I wanted as separate parameters in my query stream.  Worked a treat!  This software package is _A W E S O M E_!!!  Keep up the fantastic work!

Thanks again!

daryy

  • Guest
Re: Sending Unique Values From User Button To Chat Operator
« Reply #6 on: February 11, 2009, 01:13:31 PM »
How about php ?

psychotron

  • Full Member
  • ***
  • Posts: 7
Re: Sending Unique Values From User Button To Chat Operator
« Reply #7 on: February 16, 2009, 09:17:46 PM »
I'm not quite sure, but I would imagine you'd do similarly as I did with ASP in the button code...

/webim/client.php?locale=en&info=<%=(info)%>

Perhaps something like this...

/webim/client.php?locale=en&info=<?=$info?>

Cheers

Inspirer

  • Mibew Project founder
  • Native
  • *****
  • Posts: 262
    • Mibew Messenger
Re: Sending Unique Values From User Button To Chat Operator
« Reply #8 on: February 16, 2009, 09:33:45 PM »
Since 1.5.2 client.php takes the following arguments:
info - any information string
name - overrides the default user name
email - visitor's email

Empty values are ignored.

For example, if you have visitor name, available in javascript like:

var username = "Bill"; // or document.getElementById("name") ? document.getElementById("name").value : "";

Add the following:

<!-- webim button --><a href="/webim/client.php?locale=en" target="_blank" ..[skipped]... window.open('/webim/client.php?locale=en&url='+escape(document.location.href)+'&referrer='+escape(document.referrer)+'&name='+escape(username), 'webim', ..[skipped]