Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions
You are not logged in.
Hi !
I use Interspire to send newsletters, and in my website i have this code to get visitors data to add automatically to my list.
In which file do you suggest to add this code to add automatically to my list, all chat users ?
Thanks !
[== PHP ==]
//data from new customer HERE IS WHERE LIVEHELPER SHOULD SEND DETAILS
$first_name = $vars['firstname'];
$last_name = $vars['lastname'];
$email = $vars['email'];
$country= $vars['country']; // VA al campo 10
$city= $vars['language']; // va al campo 8
$xml = "
<xmlrequest>
<username>{$username}</username>
<usertoken>{$usertoken}</usertoken>
<requesttype>subscribers</requesttype>
<requestmethod>AddSubscriberToList</requestmethod>
<details>
<emailaddress>{$email}</emailaddress>
<mailinglist>{$list}</mailinglist>
<format>html</format>
<confirmed>yes</confirmed>
<customfields>
<item>
<fieldid>2</fieldid>
<value>{$first_name}</value>
</item>
<item>
<fieldid>3</fieldid>
<value>{$last_name}</value>
</item>
<item>
<fieldid>10</fieldid>
<value>{$country}</value>
</item>
<item>
<fieldid>8</fieldid>
<value>{$city}</value>
</item>
</customfields>
</details>
</xmlrequest>
";
$ch = curl_init($xmlpath); //CHANGE TO THE PATH OF YOUR IEM INSTALLATION
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$result = ***_exec($ch);
if($result === false) {die("Error performing request");}
//var_dump($result); //for debugging purposes
//Example of how to display returned data
$xml_doc = simplexml_load_string($result);
if ($xml_doc->status == 'SUCCESS' && empty($xml_doc->data)) {die('Status is success. Empty response.');}
if ($xml_doc->status == 'SUCCESS')
{
/* echo 'Response: <br />';
var_dump($xml_doc->data);
*/
}
else {
echo 'Error is '. $xml_doc->errormessage;
}
}
Offline
I don't know what kind of website you have but I wouldn't want to be added to a mailing list just because I started a chat. Seems obtrusive.
But if you really must, I would start here https://github.com/LiveHelperChat/liveh … extensions
Maybe use the sevabot extension.
Offline
This extension also would be a good start
https://github.com/LiveHelperChat/osTic … tstrap.php
It creates an issue once users starts a chat.
Offline
This extension also would be a good start
https://github.com/LiveHelperChat/osTic … tstrap.phpIt creates an issue once users starts a chat.
Thanks !! I will share the code when i finish it.
Offline