UserPhone

This module allows you to request site members to enter their phones and validate them via SMS (by asking users to enter the code they've received in SMS). When phone is verified, the user can be moved to another group.

To send verification SMS, you will need to use third-party SMS gateway service. Currently following are supported: Twilio, Clickatell and SMS Global.

SMS Template

SMS template is defined in module settings. Make sure to include {code} variable that will contain verification code.

Display user phone

{exp:userphone:phone}

{exp:userphone:phone member_id="CURRENT_USER"} {exp:userphone:phone username="{segment_2}"}

Parameters (all optional):

Adding phone number

To let user's add or modify phone number, you'll need to use 'add' tag.

{exp:userdata:add}

{exp:userphone:add return="/user/verify-phone"}
<p>Please provide your phone number. You will receive SMS with verification code.</p>
<p><input name="phone" value="{phone}" /></p>
<p><input type="submit" value="Add phone" /></p>
{/exp:userphone:add}

Tag parameters:

Form fields:

Variables:

Phone verification

When the phone is added, the user received SMS with verification code. To get phone number verified, he has to enter in to the form created using 'verify' tag.

{exp:userphone:verify}

{exp:userphone:verify return="/user"}
<p>
Please enter the code you have received in SMS.
<a href="{request_new_code}">Request new code</a>
</p>
<p><input name="code" value="" /></p>
<p><input type="submit" value="Verify phone" /></p>
{/exp:userphone:verify}

Tag parameters:

Form fields:

Variables:

Top of page