Email Routing Finally Available To Divi Users!
We are thrilled to announce that conditional email routing is now part of our popular Divi Contact Form Helper plugin! This means you can send the submitted form to a different email address based on which form field options are selected in the form. You could set up dropdowns, checkboxes, and radio buttons for the selection fields, and use alongside conditional logic. So now you can send the form to different address or departments within your company. How cool is that! This tutorial will show you how to set up conditional email address routing logic in the Divi Contact Form module.
▶️ Please watch the video above to get all the exciting details! 👆
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.
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.
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.
Just wondering if it’s possible to combine conditions to determine which email address to send to.
My example is there is an enquiry type as one field and location as another field.
I want to send to different email addresses based on the location ONLY if the enquiry type is a specific value
i.e.
Enquiry Type A -> send to [email protected]
Enquiry Type B AND Location A -> send to [email protected]
Enquiry Type B AND Location B -> send to [email protected]
The reason I want to do this is the location field is important for other enquiry types but the distribution to different email addresses only changes with a specific enquiry type is selected. All other enquiry types go to the same email address irrespective of the location field.
I’m thinking the only way around this at the moment is to not show the location field when the other enquiry types are selected / use a different field which looks the same for all intensive purposes but has a different name/ID.
Hi Tim,
It’s a little difficult for me to understand your scenario without seeing what you mean by location. All the options of this feature are shown in this post, so there isn’t anything else that would work. You can certainly base the logic on multiple selections, but again, not sure what you mean with locations.
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.
This feature is already in the plugin, that’s why we made this tutorial. Am I misunderstanding something?
What if you want multiple emails for each option? For example when option A is selected, you want the form to go to 3 different emails. When Option B is selected you want the form to go to a different group of however many emails, etc.
For example:
Field_4::Option A:[email protected] [email protected] [email protected]|Option B:[email protected] [email protected] [email protected] [email protected] [email protected]
Is this possible?
Thanks!
We are going to work on this! It’s not in the current version 1.3, but will be in the future versions!
Hi Nelson. Just wondering if there is an ETA on adding the send to multiple email addresses per option functionality as discussed above?
Hi Tim, I don’t have an ETA. We are swamped with other priorities. Thanks for the reminder!
Awesome, thanks!
Hi Nelson! I’m wondering if this feature was added yet?
Thanks!
Sorry not yet, we will hopefully be able to get to that soon and will be included in our changelog here: https://www.peeayecreative.com/docs/divi-contact-form-helper/changelog/
Awesome, I’ll be looking forward to the release!
This is so cool. Perfect.
Glad you like it!