The user object is accessible via the session object. The object is only available when there is a signed in user for the current session. The user object is not available for email templates.

Variables

.id

Unique ID for the user.

TYPE
numeric
CONSTRAINTS
>= 1
PRESENCE
always

Examples

CODE{{ session.user.id }}
OUTPUT92345

.name

The display name for the user.

TYPE
string
CONSTRAINTS
up to 64 characters
PRESENCE
always

Examples

CODE{{ session.user.name }}
OUTPUTJohn Smith

.account

Account associated with the currently signed in user. There can only be one active account at any one time, even if the user is associated with multiple accounts.

TYPE
account object
CONSTRAINTS
n/a
PRESENCE
always

Variable Dump

Copy and paste the below HTML into any template page, to see all user data dumped to your page. You can then simply remove the unnecessary fields and other elements, and format the remaining fields however necessary to achieve the desired look and feel.

<style> .thedump .name{ background-color:#3A5FCD; color:white; padding:0.5em; font-weight:bold; } .thedump .code{ background-color:#888888; color:white; padding:0.5em; } .thedump .out{ background-color:white; color:#555555; padding:0.5em; border-bottom:1px solid #CCCCCC; margin-bottom:1em; } .thedump .code pre{ padding:0; margin:0; font-size:1.1em; } </style> <div class="thedump"> <div class="name">User ID</div> <div class="code"><pre>&#123;&#123; session.user.id &#125;&#125;</pre></div> <div class="out">{{ session.user.id }}</div> <div class="name">User Display Name</div> <div class="code"><pre>&#123;&#123; session.user.name &#125;&#125;</pre></div> <div class="out">{{ session.user.name }}</div> </div>