This documentation relates to CiviCRM version 3.2. It's not maintained anymore.
Current version of documentation.

Get email of currently loggedin user

Skip to end of metadata
Go to start of metadata

This page refers to outdated version of CiviCRM. Check current version of documentation.


Documentation Search


CiviCRM 3.2 Documentation

Support and Participation

Developer Resources


CiviCRM book!

Make sure to check out Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

In drupal, you can get the email address of the currently logged in user from Drupal itself. Since the email is snyc'd between CiviCRM and Drupal, no need to get the email from CiviCRM.

global $user;
echo $user->mail; 
 

If you wanted to get an email address from CiviCRM (becuase you wanted a secondary, rather than primary address, for example).

Can someone provide a code sample?
 
Labels
  • None

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.