Zen Cart Logo
Forums / All Other Contributions/Addons / Help with contact_us -- customized subject field

Help with contact_us -- customized subject field

Locked

Views: 2,409

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
5 Mar 2007, 8:53 PM
#1
michellyaqua12 avatar

michellyaqua12

New Zenner

Join Date:
Jan 2007
Location:
Boston, MA, USA
Posts:
40
Plugin Contributions:
0

Help with contact_us -- customized subject field

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:

 $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);
    }
    [B]if (empty($subject)) {[/B]
[B] $messageStack->add('contact', ENTRY_EMAIL_SUBJECT_CHECK_ERROR);[/B]
[B]  }[/B]
    if (empty($enquiry)) {
      $messageStack->add('contact', ENTRY_EMAIL_CONTENT_CHECK_ERROR);
    }

And I have ENTRY_EMAIL_SUBJECT_CHECK_ERROR specified in contact_us.php.

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:

define('EMAIL_SUBJECT', 'Message about '.$subject);

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?

8 Mar 2007, 8:43 PM
#2
michellyaqua12 avatar

michellyaqua12

New Zenner

Join Date:
Jan 2007
Location:
Boston, MA, USA
Posts:
40
Plugin Contributions:
0

Re: Help with contact_us -- customized subject field

Nevermind, it's fixed! Apparently I forgot to upload the includes/modules/pages/contact_us/header_php.php that came with the download - oops!

Well, both problems are fixed now.

27 Mar 2007, 5:03 AM
#3
jeffey avatar

jeffey

Zen Follower

Join Date:
Aug 2006
Posts:
252
Plugin Contributions:
0

Re: Help with contact_us -- customized subject field

Don't know if you still tracking but..

Did you actually get the customer subject to show in the email subject line? I've been looking for a solution and even after having all the files you mentioned I'm not getting $subject in the email subject.

Any advice appreciated, I've been looking to filter email using just one email address rather than creating others.

27 Mar 2007, 2:32 PM
#4
michellyaqua12 avatar

michellyaqua12

New Zenner

Join Date:
Jan 2007
Location:
Boston, MA, USA
Posts:
40
Plugin Contributions:
0

Re: Help with contact_us -- customized subject field

The customer's subject shows in the email subject line, yes.

Maybe download the add-on again, in case there was a problem with the files? There are 3 you have to upload:

includes/languages/english/contact_us.php
includes/templates/template_default/templates/tpl_contact_us_default.php
includes/modules/pages/contact_us/header_php.php

But be careful with the first two if you have edited those files in the past. If you have, then you need to compare your edited files with the new downloaded ones and combine everything into one file. Then you have to upload the combined files correctly, using the override system. Instead of what it says above, you would upload the files to:

includes/languages/english/CUSTOM/contact_us.php or
includes/templates/CUSTOM/templates/tpl_contact_us.php

with CUSTOM being whatever name you use for your template.

If that doesn't work then I don't know.

27 Mar 2007, 8:16 PM
#5
jeffey avatar

jeffey

Zen Follower

Join Date:
Aug 2006
Posts:
252
Plugin Contributions:
0

Re: Help with contact_us -- customized subject field

Thanks for taking the time.

I didn't combine them (don't know how frankly) but I think the hang up is I've put a drop down subject list in place of the original subject section. Shows and selects but obviously not working in the true sense.

Unfortunately I know very little and I'm doing a lot of this kind of "customizing" by trial and error and comparison but still don't really understand the subtleties of the language. I'm sure there is just a single line I'm missing somewhere that tells the system to pick up my drop down selection like it does in the default "ask a question".

It's my biggest hurdle right now since I have a lot of email form like submissions I need to process but want them all to go to one email and be filtered in email by subject. Been doing it for years with my CGI scripts (yeah, I know - old school!) and I know there has to be a way to do it without creating multiple emails as is the default in Zen admin.

I think I may have confused you posting with some others on similar subjects and thought you, too, were using a drop down set of subjects.

Thanks for your comments, I always appreciate it.

Hopefully I'll solve this soon and I expect like my other major issues the forum will rescue me....again.

29 Mar 2007, 12:42 AM
#6
jeffey avatar

jeffey

Zen Follower

Join Date:
Aug 2006
Posts:
252
Plugin Contributions:
0

Re: Help with contact_us -- customized subject field

Hey MichellyAqua12,
A few posts ago you mentioned that you solved the issue of getting the subject line from contact_us to show in the subject line of the Email itself. We talked briefly and I was working on a drop down subject line which I got up there but no subject in email.

I've back tracked and got the default contact_us stuff in there again but that subject line doesn't show in email subject line either.

Can you give me some specifics on you eluded to solution (where you said you mistakenly loaded the default (and, I presume, not edited by you) copies from the mod download.

I know I'm not the only one looking for this and have to believe it is a few additional lines (though I've been known to be wrong!!).

If it's fairly easy for you and you have the time this one is the biggest hang up to my going live and once I can get the default contact_us to load the subject into the email subject line I can easily work on getting a drop down selection to work.

Can't believe this isn't a mod, I would expect lots of people to want a single email with email filtering in mail programs.

Regardless of whether your compelled this time (unspoken prayers here), thanks for your help.

29 Mar 2007, 12:46 AM
#7
jeffey avatar

jeffey

Zen Follower

Join Date:
Aug 2006
Posts:
252
Plugin Contributions:
0

Re: Help with contact_us -- customized subject field

DOH!
Forget it, I, too, made a similar mistake and must have edited the header file sometime back.

Still working the drop down if you have any thoughts.

Sorry to waste a post!