Enquiry Sent

“;
$message .= get_option(“enquiryField1Label”);
$message .= ““;
$message .= “: $field1
“;
}
if (get_option(“enquiryField2Type”)!=”hidden”) {
$message .= ““;
$message .= get_option(“enquiryField2Label”);
$message .= “
“;
$message .= “: $field2
“;
}
if (get_option(“enquiryField3Type”)!=”hidden”) {
$message .= ““;
$message .= get_option(“enquiryField3Label”);
$message .= “
“;
$message .= “: $field3
“;
}
if (get_option(“enquiryField4Type”)!=”hidden”) {
$message .= ““;
$message .= get_option(“enquiryField4Label”);
$message .= “
“;
$message .= “: $field4
“;
}
if (get_option(“enquiryField5Type”)!=”hidden”) {
$message .= ““;
$message .= get_option(“enquiryField5Label”);
$message .= “
“;
$message .= “: $field5
“;
}
if (get_option(“enquiryField6Type”)!=”hidden”) {
$message .= ““;
$message .= get_option(“enquiryField6Label”);
$message .= “
“;
$message .= “: $field6
“;
}
if (get_option(“enquiryField7Type”)!=”hidden”) {
$message .= ““;
$message .= get_option(“enquiryField7Label”);
$message .= “
“;
$message .= “: $field7
“;
}
if (get_option(“enquiryField8Type”)!=”hidden”) {
$message .= ““;
$message .= get_option(“enquiryField8Label”);
$message .= “
“;
$message .= “: $field8
“;
}

$message .= “
The following products were selected:

“;
$quantity = count($quantityArray) -1;
$i = 0;
while ($i <= $quantity) { $message .= $quantityArray[$i]; $message .= " x \””;
$message .= $descriptionArray[$i];
$message .= “\” (“;
$message .= $vehicleArray[$i];
$message .= “)
“;
$message .= “
\n”;
$i++;
}

if ($_POST[‘custom1Description’]!=””) {
$message .= $_POST[‘custom1Quantity’];
$message .= ” x “;
$message .= $_POST[‘custom1Description’];
$message .= “
“;
}
if ($_POST[‘custom2Description’]!=””) {
$message .= $_POST[‘custom2Quantity’];
$message .= ” x “;
$message .= $_POST[‘custom2Description’];
$message .= “
“;
}
if ($_POST[‘custom3Description’]!=””) {
$message .= $_POST[‘custom3Quantity’];
$message .= ” x “;
$message .= $_POST[‘custom3Description’];
$message .= “
“;
}
if ($_POST[‘custom4Description’]!=””) {
$message .= $_POST[‘custom4Quantity’];
$message .= ” x “;
$message .= $_POST[‘custom4Description’];
$message .= “
“;
}
if ($_POST[‘custom5Description’]!=””) {
$message .= $_POST[‘custom5Quantity’];
$message .= ” x “;
$message .= $_POST[‘custom5Description’];
$message .= “
“;
}

$message .= “
You would prefer to be contacted by “;
$message .= $_POST[‘preferredContact’];
$message .= “, and you have asked to “;
if ($_POST[‘CC’] != “Yes”) {
//$message .= “not “;
}
$message .= “receive a copy of this message in your inbox.

“;

echo “Thank you for your Enquiry. It has been sent by E-mail to Winston Steel. A Winston Steel representative will address your Enquiry as soon as possible.

“;
echo stripslashes($message);

echo “\"\"“;

$to = get_option(“emailRecipient”);
$subject = ‘New inquiry from website’;
$headers = ‘From: no-reply@winstonsteel.com.au’ . “\r\n” .
‘Reply-To: sales@winstonsteel.com.au’ . “\r\n” .
‘X-Mailer: PHP/’ . phpversion();
$composed = stripslashes($staffSalutation.$message);
$composed = str_replace (“
“, “\n”, $composed);
$composed = strip_tags($composed);
$composed2 = stripslashes($customerSalutation.$message);
//$composed2 = str_replace (“
“, “\n”, $composed);
//$composed2 = stripslashes($composed2);

wp_mail( $to, $subject, $composed, $headers);

if (get_option(“enquiryField1Label”)==”Email”) {
$customerEmail = $field1;
}
if (get_option(“enquiryField2Label”)==”Email”) {
$customerEmail = $field2;
}
if (get_option(“enquiryField3Label”)==”Email”) {
$customerEmail = $field3;
}
if (get_option(“enquiryField4Label”)==”Email”) {
$customerEmail = $field4;
}
if (get_option(“enquiryField5Label”)==”Email”) {
$customerEmail = $field5;
}
if (get_option(“enquiryField6Label”)==”Email”) {
$customerEmail = $field6;
}
if (get_option(“enquiryField7Label”)==”Email”) {
$customerEmail = $field7;
}
if (get_option(“enquiryField8Label”)==”Email”) {
$customerEmail = $field8;
}

if ($_POST[‘CC’] == “Yes”) {
$to = $customerEmail;
$composed2 .= “

Regards,

The Sales Team
\"Signature\"
A: 2, Stacey St, Bankstown NSW 2200 AUS
Tel: 02 9793 8001 Fax: 02 9793 2382
E: sales@winstonsteel.com.au
W: www.winstonsteel.com.au
“;
$subject = ‘Your inquiry with Winston Steel’;
$headers = ‘From: Winston Steel ‘ . “\r\n” .
‘Reply-To: sales@winstonsteel.com.au’ . “\r\n” .
‘Content-type: text/html’ . “\r\n” .
‘X-Mailer: PHP/’ . phpversion();

wp_mail( $to, $subject, $composed2, $headers);

//echo “debug — contacting customer at $customerEmail”;
}

} else {

echo “Sorry, you missed a required field. Please press the button below to go back and try again.”;
echo “\"\"“;

}
} else {
echo “Sorry, you answered the security question incorrectly. Please go back and try again.
“;
echo “\"\"“;
}

?>