David N. Posted April 16 Share Posted April 16 I am adding a javascript to my global header that will run only if the user is logged in. I've placed the javascript inside this if statement. {{if \IPS\Member::loggedIn()->member_id}} {{endif}} In the script, I need to to replace a variable with the currently logged-in user's email address, either plaintext or encrypted sha256, however I'm not sure how to get that email address? Link to comment Share on other sites More sharing options...
Nathan Explosion Posted April 16 Share Posted April 16 \IPS\Member::loggedIn()->email David N. 1 Link to comment Share on other sites More sharing options...
David N. Posted April 16 Author Share Posted April 16 Thanks a lot! And how can I access that variable inside a script (in JavaScript)? Link to comment Share on other sites More sharing options...
Solution Nathan Explosion Posted April 16 Solution Share Posted April 16 <script> alert("{expression="\IPS\Member::loggedIn()->email"}"); </script> SeNioR- and David N. 2 Link to comment Share on other sites More sharing options...
David N. Posted April 16 Author Share Posted April 16 Great, it works! Thanks again. 🙂 Link to comment Share on other sites More sharing options...
Recommended Posts