How to add title value to subject in contact form 7?

Question

I have this contact form
enter image description here

And this is how the front-end looks like
enter image description here

The url of the page is example.com/listing/philly-4-beds-1-5-baths-single-family/#contact

I need to have the subject set as Philly 4 beds 1 5 baths single-family (the title).

Here is my code in functions.php

 function action_wpcf7_contact_form( $instance ) { 
        // make action magic happen here... 
    }; 
             
    // add the action 
    add_action( 'wpcf7_contact_form', 'action_wpcf7_contact_form', 10, 1 );  

What should I add inside the function to set the subject with the value of the title?Thank you!

0
Andreea Onica 1 year 2020-07-16T08:11:33-05:00 0 Answers 50 views 0

Leave an answer

Browse
Browse