Docs

Generate Username and Password when the Opt-in Form is Submitted

Updated on

You can now set up automations to generate username and unique login passwords using merge tags in FunnelKit Automations.

Let’s suppose you want to set an account for your subscribers who submits the opt-in form. 

For this purpose, we will generate a username (their email address) and a unique password so that they can log in to their account.

Setting Up the Automation

Let’s see how you can generate a username and password for login when the Opt-in form gets submitted:

Step 1: Set up the Form Submit Event

Add an event – Form Submits under FunnelKit Optin Form.

Add the form submits event

Click on Done.

You need to configure the FunnelKit Optin form.

Select the form and map the email field here.

Select the form and map the email field

Step 2: Add a condition to check if he is an existing customer or a first-time user

Add a condition by clicking on the plus (+) icon below the event node.

Funnel Builder Form Submits automation with the Add Step menu open and an arrow at Condition

Scroll down to select the condition – if the contact is a user.

If the contact is a user

Next, add the action for this condition.

Under the If-Yes condition, add the action.

Add action option under the yes branch of a condition in the automation

Specify the Send Email action.

Specify the Send Email action

Copy the password setup link merge tag.

Read this documentation on how to use merge tags in automations.

Read this documentation on how to use merge tags in automations

Paste this merge tag into your email.

Password setup merge tag pasted into the email body of an automation

Click on Save when done.

Step 4: Add an action to create a new user under the else condition

Add an action to create a new user.

Add a direct action to create a new user

Click on Done.

Step 5: Configure the Create User action

Make use of the FunnelKit Optin form merge tag to create a user.

Opt-in form fields configured in the funnel for creating a user

Now enter the field value of email, first name, and last name using the merge tags.

We have selected the role of ‘Subscriber’ and enabled the option to save the auto-generated password for a user.

WordPress Create User action settings in a FunnelKit Automations automation

Click on Save when done.

Step 6: Add send email as your action

Select Send email as your second direct action and compose the content using merge tags:

  • For username, we’ll use the email address of the user.
  • For password, we’ll use the {{new_user_password}} merge tag.
{{new_user_password}} merge tag within your email

You can even use the FunnelKit Automations’ built-in visual email builder to design this email.

Click on the Save button.

That’s it! Your workflow has been created and you can activate your automation now.

WooCommerce generated username and password shown in the welcome email

Testing the Automation

Now, if a user fills out this FunnelKit’s opt-in form:

Submit the opt-in form

The account will get created in WordPress as per the action we specified:

User account gets created

The user will receive this email:

Email received with the login credentials

You can use this username and password to log in to your account.

This is how you can generate a username and password for your users when they submit the opt-in form.