Jump to content

Enter the logged-in member's email address in a javascript (plaintext or encrypted sha256)?

Featured Replies

Posted

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? 

Solved by Nathan Explosion

Go to solution
  • Author

Thanks a lot!

And how can I access that variable inside a script (in JavaScript)?

 

  • Solution
<script>
	alert("{expression="\IPS\Member::loggedIn()->email"}");
</script>

 

  • Author

Great, it works! Thanks again. 🙂 

Recently Browsing 0

  • No registered users viewing this page.