Support » Fixing WordPress » Contact form

  • Hi.

    I am looking for a contact form that will go to various email addresses depending on the subject field.

    The subject will be in dropdown list and when selected will send form to its related email address.

    Say if “Sales” is selected in subject field then this will go to and if “enquiries” is selected then the contact form will go to

    Is there a contact form plugin out there that has this capability?

    • This topic was modified 2 months, 3 weeks ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Tara King


    Hi @bevilleliam — You might take a look at Gravity or Contact Form to Email. I haven’t used the second one, but they both look like candidates for your use case.

    Thread Starter bevilleliam


    Thank you for your reply Tara.

    Gravity forms are deprecated and are untested with my WP theme.

    Contact form to email does not have the feature of sending to a different email address depending on the selected “subject” from dropdown

    Thread Starter bevilleliam


    I have my contact form with dropdown subject and I just need to Dynamically change recipient email
    by hook into wpcf7_before_send_mail, get the submitted form data, find the enquiry-type dropdown option and then use an if/else statement to send the notifications to specific email addresses.

    Below is the code I need help in finding where to place on my contact form…..

    `// hook into wpcf7_before_send_mail
    add_action( ‘wpcf7_before_send_mail’, ‘cf7dynamicnotifications’); // Hooking into wpcf7_before_send_mail

    function cf7dynamicnotifications($contact_form) // Create our function to be used in the above hook
    $submission = WPCF7_Submission::get_instance(); // Create instance of WPCF7_Submission class
    $posted_data = $submission->get_posted_data(); // Get all of the submitted form data

    * Here are our ‘enquiry-type’ options and associated email address for reference
    1 Bookings –
    2 Newsletters –
    4 default –

    if( $posted_data[“enquiry-type”] == ‘Bookings’ ) { // If Bookings option is selected
    $recipient_email = ‘’;
    elseif($posted_data[“enquiry-type”] == ‘Newsletters’) { // else if Newsletters option is selected
    $recipient_email = ‘’;
    elseif($posted_data[“enquiry-type”] == ‘Jobs’) { // else if Jobs option is selected
    $recipient_email = ‘’;
    else { // If no dropdown option is selected
    $recipient_email = ‘’;
    // set the email address to recipient
    $mailProp = $contact_form->get_properties(‘mail’);
    $mailProp[‘mail’][‘recipient’] = $recipient_email;

    // update the form properties
    $contact_form->set_properties(array(‘mail’ => $mailProp[‘mail’]));

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.