tigerstripemedia Posted March 21, 2019 Share Posted March 21, 2019 Hi there, I am using a live chat app called Natterly. To set it up is simple all you need to do is add a bit of JS into the footer: <script type="text/javascript" src="https://cdn.natterly.com/chatbox.js"></script> <script> chatbox = new NatterlyChatbox("[My licence goes here]"); chatbox.render(); </script> Now this works fine in WHMCS but I want to go one step further. Usually to start a chat the user has to enter their name and email address into the chat box. Natterly allows you to specify this within the script like so: <script type="text/javascript" src="https://cdn.natterly.com/chatbox.js"></script> <script> chatbox = new NatterlyChatbox("[My licence goes here]"); chatbox.visitor.name = '<visitor name here>'; chatbox.visitor.emailAddress = '<visitor email address here>'; chatbox.render(); </script> What I would like to do is grab the current logged in user's full name and email address and insert it into this script. Does anybody have any ideas on how to do this? I have tried but couldn't get it working. Thanks in advance, Hayden 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 22, 2019 Share Posted March 22, 2019 Hi Hayden, 23 hours ago, tigerstripemedia said: What I would like to do is grab the current logged in user's full name and email address and insert it into this script. Does anybody have any ideas on how to do this? I have tried but couldn't get it working. I would have thought you should be able to do this... <script type="text/javascript" src="https://cdn.natterly.com/chatbox.js"></script> <script> chatbox = new NatterlyChatbox("[My licence goes here]"); chatbox.visitor.name = '{$clientsdetails.fullname}'; chatbox.visitor.emailAddress = '{$clientsdetails.email}'; chatbox.render(); </script> if the client isn't logged in, then both values should be empty. 0 Quote Link to comment Share on other sites More sharing options...
tigerstripemedia Posted March 22, 2019 Author Share Posted March 22, 2019 3 minutes ago, brian! said: Hi Hayden, I would have thought you should be able to do this... <script type="text/javascript" src="https://cdn.natterly.com/chatbox.js"></script> <script> chatbox = new NatterlyChatbox("[My licence goes here]"); chatbox.visitor.name = '{$clientsdetails.fullname}'; chatbox.visitor.emailAddress = '{$clientsdetails.email}'; chatbox.render(); </script> if the client isn't logged in, then both values should be empty. Thanks so much Brian! That's worked! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.