Hello guys! I need your help. I want to integrate intercom.io on my whmcs as they provide great tracking services. So I read on the net where should I place the code. So far I found a way to place the script on the "footer.tpl". So far so good, but there is a second part which is to fetch the user's name and email address once he is logged in whmcs and that's the part I need help.
Here is the integration script: ( javascript as php wont work in tpl file
###########################################
<script>
window.intercomSettings = {
app_id: "000000",
name: "[color="#FF0000"]Nikola Tesla[/color]", // Full name
email: "[color="#FF0000"]nikola@example.com[/color] ", // Email address
created_at: 1312182000 // Signup date as a Unix timestamp
};
</script>
<script>(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/d05g7qra';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
###########################################
I know so far that these variables would work in php {$client->fullname} and {$client->email} but what should I put there for intercom to read the name and email of a logged user using javascript.
Your help is mostly appreciated.
Thanks
Xavier