Support » Plugin: Conditional Fields for Contact Form 7 » Conditional Fields Which Send to Different Emails

  • Resolved jwinston1776

    (@jordanwinston)


    I’m trying to create a form with conditional logic and based on the inquiry type it would send the email to one of two emails.

    Like this:

    Shown on Page Load:
    Name
    Email Address
    Drop Down (user can select “General Inquiry” or “Career Inquiry”)

    If user selects “General Inquiry”, the following fields show below name/email and the form would know to send results to info@domain.com (including name/ email from above):
    Title:
    Website:
    Company:
    Message:
    SEND BUTTON

    if user selects CAREERS, it would email the results to careers@domain.com (including name/email from above):
    Company
    Website
    Resume File Upload
    Message
    SEND BUTTON

    Does anyone know how to do this? It’s essentially using the conditional logic on the drop down which I understand from documentation but not sure how to make it email one email for the first drop down selection and another email for the other drop down selection with a different set of form fields.

    Thank you!

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    Thread Starter jwinston1776

    (@jordanwinston)

    Hi Jules –
    Thanks for the response.

    I know about the pipes, but where would i attach those pipes/emails if I don’t want the user to specifically select who they want to send it to from the drop down? For example, in this method, it allows the user to select who they want to send it to. I’d like my form to send it to one of two emails based on whether they select “GENERAL INQUIRY” (to info@domain.com) or “CAREERS INQUIRY” (to careers@domain.com).

    Ideally i’d like the following to show up on page load:
    Name
    Email
    Inquiry Type (user selects GENERAL or CAREERS)

    Once they select Inquiry Type GENERAL, 4 other fields drop down:
    Title
    Website
    Company
    Message
    –> SEND BUTTON sends to info@

    If they select CAREERS, different fields show:
    Title
    Company
    Website
    Upload Resume
    Message
    SEND BUTTON –> sends to careers@

    is it possible to attach the pipe/email to the Inquiry Type Group? Would it still capture the “Name” and “Email” from before the drop down?

    Let me know if you think there’s an easier way of doing this. Thanks so much

    Thread Starter jwinston1776

    (@jordanwinston)

    Follow Up – I was able to get the conditional form working, however I still cannot figure out how to get GENERAL INQUIRIES to send to one email and CAREERS to send to another.

    I thought about attaching those pipes to the Select Inquiry drop down, but that will not collect the “Name” or “Email Address” that sits above it. And, that still doesn’t seem to work.

    Plugin Author Jules Colle

    (@jules-colle)

    Did you read the solution without pipes as well? 2nd one. you will need that one.

    Thread Starter jwinston1776

    (@jordanwinston)

    Will this work though if i don’t want the user to select this from a drop down? I don’t want them to see a select drop down that asks them where to send it to

    Plugin Author Jules Colle

    (@jules-colle)

    Yes, sure it has nothing to do with the dropdown. By adding the group names in the To field, you are sending the emails to an address based on which group was visible during form submission.

    Thread Starter jwinston1776

    (@jordanwinston)

    Thanks so much! I used the 2nd version like you mentioned (and only had to use the bottom example to add the group names in the TO Field.

    For anyone wanting to do the same thing: just go to your contact form and follow these steps:

    1.) Under the MAIL Tab, put this format in your TO field:
    This is for 2 groups – so group 1 will send to info@domain.com and group 2 will send to careers@domain.com

    [group-name-1]info@domain.com[/group-name-1][group-name-2]careers@domain.com[/group-name-2]

    Thanks so much Jules! Great plugin!

    Plugin Author Jules Colle

    (@jules-colle)

    you’re welcome. thanks for the review. much appreciated 🙂

    Thread Starter jwinston1776

    (@jordanwinston)

    thank YOU!

    One last question, possibly unrelated but it has to do with the conditional form/groups along with the Contact Form 7 Database plugin.

    When i view my submissions, I see ALL the fields in the database. So, if the user submits ONE group, it shows their results, but shows empty fields in the database record for the other group. Is there a way to fix that?

    Plugin Author Jules Colle

    (@jules-colle)

    no. but i’m thinking of adding a save to db option to conditional fields pro.

    Thread Starter jwinston1776

    (@jordanwinston)

    Hi Jules,
    Thanks for your help on the thread above. I have a related question.

    Im creating a new form where i’m using radio buttons like this:

    [radio inquiry-type id:inquiry-type class:inquiry-type select one use_label_element “General Inquiry” “Career Inquiry”]

    I have Contact Form 7 – Conditional Fields installed as a plugin, but wondering what i need to do in this instance so that

    – if someone selects the radio button General Inquiry, it emails general@domain.com
    – if someone selects the radio button Career Inquiry, it emails careers@domain.com

    What would the markup be in the TO field under the MAIL tab
    AND
    do I need to setup something under the CONDITIONAL tab? When i go to the conditional tab, i see “select group” as the first option but there is no GROUP to select since the radio buttons appear in the same section.

    Thanks for your help!

    Plugin Author Jules Colle

    (@jules-colle)

    You could use any of the approaches described here. One is the cf7 way, the other is the conditional fields way

    https://conditional-fields-cf7.bdwm.be/docs/faq/can-i-send-the-form-to-different-email-addresses-based-on-the-selection/

    Thread Starter jwinston1776

    (@jordanwinston)

    @jules-colle thanks Jules – does this work for radio buttons though? It looks like the demo is just for the [select] or drop down selections

    For example, in this case i have “General Inquiry” as one radio button and “Career Inquiry” as the second one, both in the same radio selector:

    [radio radio-buttons default:1 “General Inquiry” “Careers Inquiry”]

    Plugin Author Jules Colle

    (@jules-colle)

    jep select and radio work just the same

    Thread Starter jwinston1776

    (@jordanwinston)

    @jules-colle

    So, I have for my radio button options
    General Inquiry
    Careers Inquiry

    So, in the “TO” Field under “MAIL” tab, would I just do:

    [general-inquiry-selected]jws@domain.com[/general-inquiry-selected][careers-inquiry-selected]careers@domain.com[/careers-support-selected]

    basically, the [general-inquiry-selected] part.. does that need to match the name of the radio button option?

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Conditional Fields Which Send to Different Emails’ is closed to new replies.