Using Automation Component to create a new WordPress user account.

Post written by Hudson Atwell
On Monday, May 7th, 2018

Inbound Now ships a WordPress plugin called Inbound Pro which offers a intense marketing automation component that can perform actions based on sitewide events using WordPress’s internal hooks and filters system.

One of the events we can listen to is fired when a new lead is created inside our leads plugin. This trigger event happens when an Inbound Form is submitted, or a 3rd party form like Gravity Forms or Ninja Forms, that’s connected to our plugin, is submitted.

In this guide I’ll show how to use our Automation component to:

  1. Create a new automation rule that targets new leads
  2. Create an action that creates a new WordPress User
  3. Assign a user role to created user
  4. Optionally log the user in automatically.

1. Create a new automation rule that targets new leads

Please note that our powerful automation component is a gated feature that we provide to active Inbound Now subscribers only.   Also notice that in the rule below we have a section titled “Define Conditions”. In this section we use data sent over by our selected trigger to determine if we should continue processing the event.

2-4. Create an action that creates a new WordPress User, Adds a role, logs the user in

After setting up the conditions for our actions we can create the actions themselves. In this case we are:

  1. Creating a new user based on data included in the form submission
  2. Assigning the user to the ‘Seller’ userrole.
  3. Logging in the user immediately.

An additional feature of the ‘Create User’ action is that a password reset email is immediately generated and sent to the new user.

Within our Automation Component we provide the user the option to process the rule immediately or defer it to a processing queue. Since we’re login users in we need to process users immediately, otherwise the login cookies will not set correctly. We actually added the deferment control features to support automatic logins.

 

About the Author:
Cheers! Hudson Atwell is a co-founder and the current CEO of Inbound Now. You can follow him on his Twitter at @atwellpub or request him for work on Codeable.io. Thanks for reading!

Continue Reading

Signup and get started with Inbound Now

Sign Up for Free

Download

[gravityform id="3" name="Popup Form" title="false" description="false" ajax="true"]