Overview
Account email verification is an optional feature that can be enabled during the signup process. This ensures that users have a valid and unique email address before they can create an account on your site.
When enabled, a user follows the standard signup flow, but after hitting submit, they are taken to a signup thanks page instead of straight to the setup wizard. The system then generates an email with a unique hash code link that the user must follow to complete his account activation.
Setup
If you are interested in activating this feature, please contact your Project Manager. This feature does require setup work by the ONEsite team before it can be activated.
Once activated there are three more steps:
- create the signup thanks page
- update the signup email template
- create the signup confirmation page
Signup Thanks Page
The signup thanks page lets the user know that while their new signup has been submitted, they must respond to the confirmation email before continuing.
Create new smarty file:
- Type: Page
- Name: signup/thanks
Text and styling for this template are customizable.
{php}
if( isset($_COOKIE['_cu_signup_xref']) ) {
print "<script>document.location.href='".$_COOKIE['_cu_signup_xref']."';</script>";
}
{/php}
<style type="text/css">
{literal}
.sn_thx_header {
text-align:center;
font-size:150%;
font-weight:bold;
margin:30px 0 40px 0;
color:#333333;
}
.sn_thx_nextstep {
font-size:110%;
color:#111111;
}
{/literal}
</style>
<div class="sn_thx_header">
Thank you for signing up with {$NETWORK_NAME}!
</div>
<div class="sn_thx_nextstep">
An email confirmation has been sent to the email address you listed in the signup form.
Please follow the link in that email to finish setting up your new account.
</div>
Signup Email Template
All network email templates can be found in the control panel at Plugins > Email > Email Templates.
You will need to update the signup email templates to include the special hash tag in the signup link.
<b>Hello [USER_NAME], click here to begin using your account:<br />
<a href="{$to_domain}/go/signup/confirm?hs={$signup_hash}">
Signup Confirmation Page
The signup confirmation page is where users are sent once they click on the confirmation link in the signup email. Like the signup thanks page, the text on this page can be customized for your network.
Create new smarty file:
- Type: Page
- Name: signup/confirm
{*
* Assign basic site variables
*}
{assign var='node_id' value=$PAGE->NODE_ID}
{assign var='blog_id' value=$PAGE->BLOG_ID}
{assign var='blog_owner' value=$PAGE->BLOG_OWNER}
{*
* Only if not logged in
*}
{if !$user_id}
{*
* Load user object
*}
{factory class='one_core_user_profile' identifiers=$blog_owner assign='user_profile'}
{*
* Verify username of this user is the same as the one passed in
*}
{if $user_profile}
{* Grab user_profile username *}
{assign var='user_profile_username' value=$user_profile->username}
{* SHA1 this username *}
{set var=$user_profile_username value=$user_profile_username|sha1}
{*
* Run service to update account info if usernames match
*}
{if $user_profile_username == $smarty.get.hs}
<style type="text/css">
{literal}
.sn_cn_success {
font-size:120%;
font-weight:bold;
margin-bottom:20px;
}
{/literal}
</style>
{one_service service="svcUsers" action="updUserStatus" assign="user_update" userID=$blog_owner status="pending" nodeID=$node_id}
{one_service service="svcUsers" action="getStatusCode" assign="user_update_success"}
{one_service service="svcUsers" action="getStatusMessage" assign="user_update_message"}
{* Check for success *}
{if $user_update_success == 1}
<div class="sn_cn_success">Thank you. Your account has been activated. Please login.</div>
<div class="sn_cn_loginmod">
{load_module mod_name='login' params="redirect_url=/"}
</div>
{else}
<div class="sn_cn_fail">Sorry. There was an error activating your account.</div>
{/if}
{else}
<div class="sn_cn_fail">Sorry. The information is invalid.</div>
{/if}
{/if}
{else}
{header_redirect url="/"}
{/if}