Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2007
    Location
    Boston, MA, USA
    Posts
    40
    Plugin Contributions
    0

    Default 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:

    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);
        }
    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:

    Code:
    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?

  2. #2
    Join Date
    Jan 2007
    Location
    Boston, MA, USA
    Posts
    40
    Plugin Contributions
    0

    Default 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.

  3. #3
    Join Date
    Aug 2006
    Posts
    254
    Plugin Contributions
    0

    Default 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.

  4. #4
    Join Date
    Jan 2007
    Location
    Boston, MA, USA
    Posts
    40
    Plugin Contributions
    0

    Default 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.

  5. #5
    Join Date
    Aug 2006
    Posts
    254
    Plugin Contributions
    0

    Default 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.

  6. #6
    Join Date
    Aug 2006
    Posts
    254
    Plugin Contributions
    0

    Default 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.

  7. #7
    Join Date
    Aug 2006
    Posts
    254
    Plugin Contributions
    0

    Default 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!

 

 

Similar Threads

  1. Make subject field optional on contact_us
    By gunni in forum General Questions
    Replies: 13
    Last Post: 29 Jul 2016, 09:20 AM
  2. v150 Some emails coming with subject 1
    By crashxtrme in forum General Questions
    Replies: 3
    Last Post: 10 Sep 2012, 08:25 PM
  3. help with customized link bar & ez-pages?
    By paperbliss in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 10 Nov 2010, 01:22 AM
  4. Captcha Number Subject -- Subject only not working
    By isbrucker in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 9 Feb 2010, 09:37 PM
  5. Add subject field to contact us
    By high2K in forum General Questions
    Replies: 0
    Last Post: 19 Jun 2007, 04:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg