When working with a team, it’s important to make sure everyone is getting their share of the leads (or doing their share of the work). This tutorial will show you how to automatically distribute leads generated from a Gravity Form. Let’s get started!
This tutorial requires the Gravity Forms Round Robin snippet. Once you have it inserted into your theme’s functions.php file, follow the steps below.
Step 1 – Add a Drop Down Field
Start by adding a Drop Down field to your form. The options input into this field are what the snippet will cycle through, so we’re going to insert the email addresses for our sales team.
This field will be hidden by default, and the submitted value of this field will always be overridden by the snippet.
This field serves two purposes. First, it will identify to which salesperson the lead was assigned. Second, it will be used below to send a notification to the assigned salesperson so they can get to work on the new lead.
Send More Leads to a Specific Emails
Many email services support special characters as aliases for emails. Using aliases, you can add the same address to the Drop Down to send more leads to some addresses instead of others. Here’s a short list of common email providers and their support for email aliases:
- Gmail supports using
.in email addresses to create aliases. For example, all of these addresses will be delivered to
- Yahoo supports only using a dot in addresses like this:
- Outlook supports only using a plus in addresses like this:
Step 2 – Configure Snippet
field_id in the snippet to match your Form ID and the Field ID for your Drop Down from above.
new GW_Round_Robin( array( 'form_id' => 123, 'field_id' => 4, ) );
Step 3 – Configure Notifications
Next, create a notification, set the Send To setting to “Select a Field”, and choose your Drop Down field.
That’s all there is for setup. When the first entry is submitted to the form, the Round Robin snippet will send the lead to the first name in the list, in our case to
firstname.lastname@example.org. The next entry will be sent to
email@example.com, and so on. Once the end of the list is reached, it will start over with David and continue cycling.
Dynamically Populate Your Recipients
With GF Populate Anything, you can automatically populate the email addresses.
Check the Populate choices dynamically checkbox and set the Type to “User”. If your sales people have a particular role, filter by role.
Set the Value for the Choice Template to “User Email”.
Any sales person with the Role of Sales will automatically be added to the list. The beauty of this approach is that as your team changes over time, Populate Anything will automatically update the list without any user intervention.