Hi All,

I've got this mod installed:

osCommerce: Super Contact us enhancement 1.0

However, I've run into a bit of a snag. I can't get the script to e-mail me with the new variables (email subject and order id). It also is not error checking properly, and I don't get a confirmation page message. Can someone help? It's very close. Here is my working example:

Contact Us : Holy Family Hermitage—Camaldoloese Hermits of Monte Corona

Here is what I have currently in my contact page:

$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

// BOF: Remove blank emails
// if (tep_validate_email($email_address)) {
// tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);
// tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
// } else {
// $error = true;
// $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
if (! tep_validate_email($email_address)) {
$error = true;
$messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
}
if ($enquiry == '') {
$error = true;
$messageStack->add('contact', ENTRY_EMAIL_CONTENT_CHECK_ERROR);
}
if ($error == false) {
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);
tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));

The instructions for the mod say this:

OPEN catalog/contact_us.php
At round about line 20 or 21 find
$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
if (tep_validate_email($email_address)) {
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);
tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));

THEN REPLACE IT WITH THIS

// BOF Super Contact us enhancement 1.4
$order_id = tep_db_prepare_input($HTTP_POST_VARS['order_id']);
if ($order_id <> NULL){
$enquiry = 'Order ID: ' . $order_id . "\n\n" . tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
}else{
$enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);
}
$emailsubject = tep_db_prepare_input($HTTP_POST_VARS['reason']) . ' ' . EMAIL_SUBJECT;
if (tep_validate_email($email_address)) {
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $emailsubject, $enquiry, $name, $email_address);
if (CONTACT_US_LIST !=''){
$send_to_array=explode("," ,CONTACT_US_LIST);
preg_match('/\<[^>]+\>/', $send_to_array[$send_to], $send_email_array);
$send_to_email= eregi_replace (">", "", $send_email_array[0]);
$send_to_email= eregi_replace ("<", "", $send_to_email);
tep_mail(preg_replace('/\<[^*]*/', '', $send_to_array[$send_to]), $send_to_email, $emailsubject, $enquiry, $name, $email_address);
}else{
//tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=send'));
}
// EOF Super Contact us enhancement 1.4