Some things I'd like to change on the contact_us page:
1. Make it so customers cannot send a message without a subject
2. Make the subject specified by the customer the subject line of the email I receive (EMAIL_SUBJECT)
Ok, I have a subject field added to the contact_us page from this download. And I've sort of achieved #1, but not completely. I edited includes/modules/pages/contact_us/header_php.php to include the part in bold:
And I have ENTRY_EMAIL_SUBJECT_CHECK_ERROR specified in contact_us.php.Code:$error = true; if (empty($name)) { $messageStack->add('contact', ENTRY_EMAIL_NAME_CHECK_ERROR); } if ($zc_validate_email == false) { $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } if (empty($subject)) { $messageStack->add('contact', ENTRY_EMAIL_SUBJECT_CHECK_ERROR); } if (empty($enquiry)) { $messageStack->add('contact', ENTRY_EMAIL_CONTENT_CHECK_ERROR); }
When I try to use the contact form without a subject or message, I get the appropriate error messages. But once I put in a message, I'm able to send the email. It seems it only has a problem with the empty subject field if the message field is empty too. How can I fix this?
With #2, I have tried putting this in contact_us.php, but it doesn't work:
The subject is definitely defined as $subject in tpl_contact_us.php. I have even tried putting in $name and stuff like that, but it doesn't work. It seems that it doesn't want to put anything not within the single quotes into the subject line. Is there a way around this? Like is there something I can put in includes/modules/pages/contact_us/header_php.php that tells it to automatically put $subject into the email subject line?Code:define('EMAIL_SUBJECT', 'Message about '.$subject);



