Home » Send Emails To Different People Based On Dropdown Selection: Contact Form 7

Send Emails To Different People Based On Dropdown Selection: Contact Form 7

Last updated on December 24, 2020 by

In this article, we will teach you how to send emails to different people based on dropdown selection on Contact Form 7. Let’s first understand what we wanted to achieve?

What we want to do?

Assume that you are the owner of a reputed company. Your company has different offices/departments in different cities.

So you want to submit all queries to the relevant office/department. Let’s say you have “Administrator”, “Support”, “Technical” and “Sales” department.

Now, Let’s set up a Contact Form 7 in a way so you will receive emails on above mentioned offices/departments.

Selectable Recipient in Contact Form 7

  1. Create dropdown with options “Administrator”, “Support”, “Technical” and “Sales” in Contact Form 7 as following:
[select your-recipient "Administrator"
                       "Support"
                       "Technical"
                       "Sales"]
  1. Now, add email addresses as a value to each option using pipe (|) sign.
[select your-recipient "Administrator|admin@example.com"
                       "Support|support@example.com"
                       "Technical|technical@example.com"
                       "Sales|sales@example.com"]
Selectable Recipient Dropdown Contact Form 7
  1. Go to the “Mail” tab and set the mail tag "[your-recipient]" into the To: field. This setting ensures that the email is sent to the specified email address that the sender selected. Don’t take a tension about invalid mailbox syntax.
Selectable Recipient Contact form 7 To Field
  1. We are done now. Try to submit 2-3 mails by selecting a different dropdown option. Make sure that your mail sending mechanism working. If not then install any simple SMTP plugin to make it work.

Additional Information

To get the value before pipe (|) sign use [your-recipient] as we already did in To: field of Mail tab.

To get the value after pipe (|) sign use [_raw_{field name}]. In our case, {field name} is your-recipient. So finally, it will be [_raw_your-recipient]. This can be handy in the Message body.

That’s it for now. We hope this post helps you to learn how to send emails to different people based on dropdown selection in Contact Form 7.

Additionally, read our guide:

  1. How to Add Products Per Page Dropdown in WooCommerce
  2. “Sorry, your session has expired. Return to homepage” – WordPress WooCommerce Error
  3. How to Create a Plugin in WordPress from Scratch
  4. How to Disable Admin Bar in WordPress Without Plugin
  5. How To Send Custom Emails in WordPress
  6. How to Allow Preview of Draft Post Without Login in WordPress
  7. Change WordPress Login Logo Without Plugin
  8. Contact Form 7 is not Working Issue in WordPress

Please let us know in the comments if everything worked as expected, your issues or any questions. If you think this article saved your time & money, please do comment, share, like & subscribe. Thank you for reading this post 🙂 Keep Smiling! Happy Coding!

 
 

Leave a Comment