if_user_email_verified
The if_user_email_verified conditional allows you to display content in Aurora Smarty templates based on whether a visitor that has logged into the site has verified their email address or not.
This article describes what this function does, how it should be used, and when.
Introduction
The if_user_email_verified conditional allows you to display content in Aurora Smarty templates based on whether a visitor that has logged into the site has verified their email address or not.
How and where to call this function
This feature can be used in any of Aurora's front-end Templates and even in the Order Email Templates if desired.
Accepted Parameters
Parameter | Values | Default | Description | Required? |
---|---|---|---|---|
id | Positive Integer | The currently logged-in user's Aurora User ID | The Internal ID Aurora uses to identify Users or Customers of the site. | No |
Under most circumstances you should not provide the id field and simply let Aurora collect the User ID from the current user's session.
Times you might provide a specific ID here include (but are not limited to) sending out order emails and so using the User ID attached to the order for this method instead of the current user (where the current user could in fact be an administrator triggering an email from the back-end).
Examples
Example Aurora Template: templates/example.com/members/email/verify/view.tpl.html
A very simple application of this method has been included below to demonstrate this feature.
{if_user_email_verified}
<p>Your email address ({$smarty.session.user.email_address}) has been successfully verified.</p>
<p>To change your email address, go to the <a href="/members/settings">Members Settings</a> area.</p>
{if_user_email_verified_else}
<p>Your email address ({$smarty.session.user.email_address}) has not yet been verified.</p>
<p>If you would like to re-send the verification email, <a href="#" class="ac_resend_email_verification">click here</a>.</p>
{/if_user_email_verified}
Updated over 2 years ago