Reputation: 105
I have a form having fields like this.
<form action="http://localhost/brands/?page_id=14" method="get">
<p>
<label>*Graphic Size:</label>
<select name="size">
<option>6X6</option>
</select>
</p>
<p>
<label>*Frame Color:</label>
<select name="color">
<option>Silver</option>
<option>Gold</option>
</select>
</p>
<p>
<label>Quantity:</label>
<input name="quantity" class="quantity" class="number" type="number" value="10" />
</p>
<p style="width:100%;">
<a href="#"><span style="background:#447838; padding:5px 20px;">Get Quote</span></a>
</p>
</form>
Question: I want to send these values with contact form 7.
$_GET['size'];
$_GET['color'];
$_GET['quantity'];
contact form 7 have these fields.
From: [your-name] <[your-email]>
Subject: [your-subject]
Subject: [Company]
Subject: [Phone]
Upvotes: 0
Views: 3118
Reputation: 50767
I have no idea what the two relationships are, but you shouldn't be hard coding those fields inside of a CF7 form object. Instead, add them properly, and hook into the wpcf7_before_send_mail
method from within your functions.php
file.
function pre_process_fields(){
$size = $WPCF7_ContactForm->posted_data['size'];
$color = $WPCF7_ContactForm->posted_data['color'];
$quantity = $WPCF7_ContactForm->posted_data['quantity'];
//do something with them?
}
add_action('wpcf7_before_send_mail', 'pre_process_fields');
Hopefully this gives you some clarity.
Upvotes: 3