How To Set Conditional Admin Email Address Routing In The Divi Contact Form Tutorial By Pee Aye Creative

How To Set Conditional Admin Email Address Routing In The Divi Contact Form

Nelson Miller Pee Aye Creative
In this tutorial, I will show you how to set up conditional admin email address routing based on selections in the Divi Contact Form module.

NOTE: You can only achieve this by using the Divi Contact Form Helper plugin! I rarely do tutorials that feature our plugins without some free alternative, but for something like this, there is simply no possible way to achieve it.

Divi Contact Form Helper by Pee Aye Creative

Join subscribers on our YouTube channel and enjoy other Divi video tutorials!

1. Install The Divi Contact Form Helper Plugin

The first step to set up conditional email routing is to install the Divi Contact Form Helper plugin. This plugin adds tons of settings and feature directly to the existing Contact Form module, and email routing is one of them. 

2. Set Up Your Contact Form Fields

The email routing feature will work by send the message to a specific email dress based on the select form fields using field IDs and their values. If you do not have the form added yet, please add the module to your layout and set up your fields. If you already have it set up, it will be a good idea to review the fields and check the field IDs. You will need to have either a dropdown field, checkboxes, or radio buttons for this to work. Take special note to the field IDs. We will come back to this in step #4.

3. Enable The Conditional Email Routing Setting

After the fields are set up, scroll down to the “Admin Email” settings group toggle. There you will see various settings related to the admin email. Enable the “Use Conditional Email Address Routing” setting. Enabling the setting will show a new textarea box for writing the email address routing logic. 

conditional email address routing in the Divi Contact Form Helper plugin

4. Write the Email Routing Logic

The email address routing textarea is where you will tell the plugin where to send the message based on specific criteria. Don’t worry about writing logic, it is very easy to do! Be sure to follow the video if you get stuck!

As mentioned before, the email routing works by using the form field ID and value. You will need to enter the field IDs and option values in a specific pattern. The pattern of the email routing conditional logic is like this:

Single Address Logic Pattern

FIELD_ID::Option Value:emailaddress|Option Value:emailaddress

Go to the field used as the selection options and check the Field ID. You will see it when you open up the field. In the example in the video, the Field_4 is a radio button field type with Option A and Option B options. This means if the person filling out the form selects Option A, it will send to sales@, or if they select Option B, it will send to support@.

At this time only one email address can be used per option.

Simple Example From Video:

Field_4::Option A:[email protected]|Option B:[email protected]

The example I shared above was simple, but the plugin also has the ability to take it the next level by sending the form to more than one email address. To do this, you need to add multiple sets of logic separated by commas. 

Multiple Addresses Logic Pattern

FIELD_ID::Option Value:emailaddress|Option Value:emailaddress,
FIELD_ID::Option Value:emailaddress|Option Value:emailaddress

In the example in the video, the Departments field is checkboxes with Research and Development options. The Sales field is radio buttons with Onboarding and Promotion options. The Distribution field is a select dropdown with Packaging and Shipping options.

Advanced Example From Video

Departments::Market Research:[email protected]|Product Development:[email protected],
Sales::Onboarding:[email protected]|Promotion:[email protected]|General Inquiry:[email protected],
Distribution::Packaging:[email protected]|Shipping:[email protected]

The message will send to any/all matching options.

Last updated Apr 14, 2023 @ 12:33 pm

Subscribe

Each month we send out a roundup email newsletter with the latest tutorials, product updates, helpful resources, and any other industry or personal news. Occasionally we send an extra separate email here and there if we just can’t wait! So that’s what you will get if you subscribe, and you can always unsubscribe at any time if you just can’t take it anymore :)

Blog Post Optin

Please share this post!

Nelson Lee Miller (aka The Divi Teacher)

Nelson is the owner of Pee-Aye Creative in the beautiful state of Pennsylvania. He loves helping small businesses, exploring outdoors, building websites with Divi, and teaching others.
Pee Aye Creative Black Friday Sale

Our Once A Year Sale Is Happening Now!!!

25% OFF all Divi Plugins, Courses, and Child Themes!

Shop The Sale Now!

Asset 7

Shop Our Divi Products

Plugins • Courses • Templates

Visit The Shop

Pee Aye Creative Black Friday Sale

Our Once A Year Sale Is Happening Now!!!

25% OFF all Divi Plugins, Courses, and Child Themes!

Shop The Sale Now!

Divi Tutorials On YouTube

Our videos have views! Join subscribers and enjoy over video tutorials!

Visit Our Channel

Leave A Response!

By commenting you agree to our Blog & YouTube Comments Policy

22 Comments

  1. Edvard Larsson

    This is so cool. Perfect.

    Reply
  2. Aaron

    Hey, Nelson,
    I’m still very much looking forward to this feature being added! I peaked at the changelog and didn’t see it yet. Great work on all the news features and functionality and continued development.

    Reply
  3. Dave Doherty

    Thanks for the post, I was hoping it might be a solution for what I’m trying to do… Any thoughts on this?

    In Divi Contact Form, any way to dynamically set subject based on calling URL – something like:
    …/contact-us/#et_pb_contact_form_0 Subject=”General Information”

    My goal is to use one contact form and help the user by setting one of the dropdown subjects we have.
    For example, if they want to contact us about volunteering from the volunteer page – we send them to the contact form and preselect from the subject dropdown ‘volunteer’ with something like
    …/contact-us/#et_pb_contact_form_0 Subject=”Volunteer”

    (or any other way)

    Reply
    • Nelson Lee Miller (aka The Divi Teacher)

      Hi Dave, so basically you want a conditional subject line. I think you can do this with a merge tab in the subject line. Just use the merge tab for the field ID of the dropdown selector – in theory that should work!

      Reply
  4. Paul

    Hi Nelson, thank you for this guide. in a different scenario, if I want to change the redirection link depending on the selected dropdown is it also possible?

    Reply
    • Nelson Lee Miller (aka The Divi Teacher)

      At this time we don’t have any setting like that, but it is a fine idea and we will add it to our long development list to consider for the future.

      Reply
  5. Joe Barnosky

    Hey Nelson, thank you so much for this feature! It’s awesome!

    Quick question: is it possible to set it up this way so that it *only* sends an e-mail if a certain field is selected?

    Our use case: we’re collecting RSVPs for an Easter Egg Hunt at our church, and we have the RSVP form set up to ask for the parent/guardian’s e-mail and phone number if they don’t regularly attend at our church. Honestly, we don’t need an e-mail every time someone registers, we’ll just get numbers from the database. But we WOULD like to get an e-mail specifically if it’s going to be a guest, i.e. if they select “No.”

    If I have the first question’s Field ID as ‘Attendance’ — can I use “Attendance::No:kidsmin@ourchurch” and leave nothing in the second field “|Yes:office@ourchurch” — or “|Yes:none” or… how will that work? Or I guess I should ask: what’s the *best* way to make that work?

    Thanks so much for all of your hard work! This plugin is so dang handy!

    Reply
    • Hemant Gaba

      Hi Joe!

      Yes, the above method you have shared above should work. Let us know if it doesn’t so that we’ll look more into it.

      Thank you!

      Reply
  6. Raphaël

    Hi, great solution !
    Question : is there a multisteps option (if not, maybe soon ?)
    Thx

    Reply
    • Hemant Gaba

      Hi Raphaël!

      Could you please share some more details of the requirement you’re looking for?

      Reply
  7. Christin

    I have added the plugin but when I check on the front-end and I start filling out the form at https://vannpax.eclipsemarketing.co.za/ then field Location which has the email routing logic as described above, it disappears. Can you please help?

    Reply
    • Hemant Gaba

      Hi Leon!

      I’m glad you have liked the product. We are going to work on this!

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Recent Posts

0

Your Cart