Jump to content

Acquiring Logged in Client Variables


Recommended Posts

I'm trying to acquire logged in client's variables so it will propagate the client's data. I've implemented the live chat and it is working fine, but it won't identify any of the variables?  Any suggestions??

(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/mlfxfdcw';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();


  window.intercomSettings = {
    app_id: "mlfxfdcw",
    name: "{$LANG.clientareafirstname}", // Full name
    email: "{supportticketsclientemail}", // Email address
    created_at: "<?php echo strtotime($current_user->created_at) ?>" // Signup date as a Unix timestamp
  };

(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/mlfxfdcw';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})();

 

Link to comment
Share on other sites

4 hours ago, brian! said:

if the user is logged in (and hence a client), you might be able to use {$clientsdetails.fullname} for their full name and {$clientsdetails.email} for their email address - though I don't know for sure if it would work.

Ok, just to make sure, will I have to find some way for it to reference the SMARTY variables?

Link to comment
Share on other sites

2 minutes ago, Hickman.io said:

Ok, just to make sure, will I have to find some way for it to reference the SMARTY variables?

I assumed you already had - as your example code is referencing Smarty variables... well it's referencing two Language Strings (which will be no good for your purpose)...

you might need to use <literal>, but which Live Chat addon are you using ??

Link to comment
Share on other sites

Just now, brian! said:

i'm not familiar with that one - I see there's a monthly cost... have you taken a look at tawk.to ? that chat addon is free and i've seen a lot of WHMCS installs using it.

Yes there is a monthly cost, but the automation the chat provides is definitely worth it. Also, it has a lot of apps that integrate into the chat that are great!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated