User Registration with Email ValidationPRO

This knowledge base article relates to the WS Form User Management add-on. Included with the Agency edition or buy separately for other editions.

You may wish to validate an email address prior to someone registering on your website. To do this you can use the WS Form Email Validation functionality in conjunction with the User Management register action. This method is also known as a double opt-in.

Demo

Want to jump in and see how it is done? Download a demo form and import it into WS Form.

How it Works

The full form is shown below.

User Registration with Email Validation - Form

Email validation is a two step process. The form contains two sections. One section is shown when the form initially loads, i.e. when the email address is unvalidated. The second section is only shown once the email address has been validated. The section visibility is achieved by using some simple conditional logic.

The conditional logic used to control the sections is shown below:

User Registration with Email Validation - Conditional Logic

So, when the submission is not email validated, the ELSE statement runs and shows section 1 but hides section 2. When the submission is email validated, the THEN statement runs and shows section 2 but hides section 1.

Step 1

In step 1, we request the users email address in the first section of the form. This allows us to send them an email containing a validation link. The email is sent when the Validate button is clicked which is a Save button. We use a save button because it saves the form fields (i.e. the email address) but does not submit the form and run any other actions that are configured to run on submit.

When the Validate button is clicked, two actions run.

  1. A Send Email action runs that sends an email to the email address provided. The email contains the #submit_url WS Form variable which is what the user will click on to validate their email addres.
  2. A Show Message action runs to notify the user that an email has been to sent to them.

In step 2, the email address field will be hidden, therefore we need to ensure the Always Include in Actions setting is checked. This ensures that even though the first section is hidden, the email address will still be available for when we register the user.

Step 2

Once the user has clicked the link in the email, they will be returned back to the same URL the form was on and WS Form will show section 2 as a result of the conditional logic running.

The user is prompted to enter their first name, last name and choose a password. You’ll notice some conditional logic on the form for confirming that the password has been entered correctly twice.

When the Register button is clicked, two actions run.

  1. A User Management action runs configured to user the Register method. The form fields are mapped to the appropriate user registration fields in the action.
  2. A Show Message action runs to notify the user that they have been successfully registered.