+ Reply to Thread
Results 1 to 3 of 3

Thread: mail_options issue, and templateurl template issu

  1. #1
    Join Date
    Oct 2006
    Posts
    2

    Default mail_options issue, and templateurl template issu

    Hi there,

    Firstly, I've used the tectite formmail in various guises over the past month and think it's a fantastic product, so well done to you on that.

    Unfortunately, a couple of problems (fyi I'm using v7.10)...

    1) I now use a mail.ini to simplify the html on the front end, and have all the hidden fields in it. However, I've found that 'mail_options' field (specifically for use with 'HTMLTemplate') does not seem to work when it's in the INI file. I can only get the templates to work when the field is used in the html (ie <input name="mail_options".....).

    Is this by design, or something just not working quite right?


    2) I'm wanting to use php templates rather than HTML by using 'templateurl' instead of 'templatedir' (so I can do a little more processing of what info is displayed to the recipient. However, I've figured out (by process of multiple testing and ever increasing levels of printing debugging variables!) that nothing (beyond USER_AGENT) seems to be sent to the .php template (ie at the top of my script i have print_r($_GET) & print_r($_POST), and it just returns "Array ( ) Array ( [USER_AGENT] => Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8 )")

    Am I being stupid, or is there something wrong, because if the template is not receiving ANY data from formmail, then how's it supposed to work?

    Incidentally, the HTML form is as follows:

    HTML Code:
    <form id="contact_form" action="/_library/formmail.php" method="post">
        <input type="hidden" name="mail_options" value="HTMLTemplate=template.php,TemplateMissing=&nbsp;" />
    
        <p><label class="label" for="realname">Name</label><input type="text" id="realname" name="realname" class="input" value="Tom" /></p>
    
        <p><label class="label" for="email">Email Address</label><input type="text" id="email" name="email" class="input" value="tom@squeegee-design.co.uk" /></p>
    
        <p><label class="label" for="telephone">Telephone</label><input type="text" id="telephone" name="telephone" class="input" value="07790" /></p>
    
        <p><label class="label" for="enquiry">Enquiry</label><textarea id="enquiry" name="enquiry" class="input"/>test</textarea></p>
    
        <p>How would you prefer to be contacted?
            <label for="by_email"><input name="contact_by" type="radio" value="by_email" id="by_email" checked="checked" />
            By Email </label>
            <label for="by_telephone"><input name="contact_by" type="radio" value="by_telephone" id="by_telephone" />
            By Telephone </label>
        </p>
        <p><input type="submit" value="Submit"  class="floatright"/></p>
    
    </form>
    Mail Ini:

    Code:
    [email_addresses]
    sqg = "#####"
    tom = "#####"
    simon = "#####"
    user = "#####"
    
    [special_fields]
    recipients = "tom"
    required = "realname"
    good_url = "../contact_me.php?thankyou"
    bad_url = "../contact_me.php?whoops"
    this_form = "#####/contact_me.php"
    subject = "##### Website Enquiry"
    derive_fields = "contactmethod = email + telephone,ipaddr = REMOTE_ADDR,browser = HTTP_USER_AGENT, referrer = HTTP_REFERER"
    env_report = "REMOTE_HOST,REMOTE_ADDR,REMOTE_USER,HTTP_USER_AGENT"
    Any ideas on either of my problems?

    Cheers, and keep up the good work!!

  2. #2
    Join Date
    Oct 2006
    Posts
    2

    Default Re: mail_options issue, and templateurl template issu

    Hi again,

    Please disregard the second problem, as it looks like I misread/mistook the functionality of the system. I thought formmail sent the fields to the template, which returns the completed/filled in template to be emailed to the recipient (which would be far more powerful, BTW). However, it looks like formmail simply loads the template in the same way as templatedir function. Shame.

    The first point still stands, though, with the addition that 'derived_fields' also seems to cause problems when used within the INI file.

    Cheers

    Tom

  3. #3
    Join Date
    Dec 2003
    Posts
    3,901

    Default Re: mail_options issue, and templateurl template issu

    Hi,

    1) I now use a mail.ini to simplify the html on the front end, and have all the hidden fields in it. However, I've found that 'mail_options' field (specifically for use with 'HTMLTemplate') does not seem to work when it's in the INI file. I can only get the templates to work when the field is used in the html (ie <input name="mail_options".....).

    Is this by design, or something just not working quite right?
    Not by design, it's just not implemented yet.

    Here's a comment you'll find in the source...

    PHP Code:
                    //
                    // NOTE: there is a minor bug here now that we support
                    // $FORM_INI_FILE. The INI file is processed at the end
                    // so if you set the mail_options below in the INI file they
                    // won't get processed here.  This means you must set
                    // the following mail_options in the HTML form for now.
                    // (To be fixed at a later date.  RJR 17-Feb-06).
                    // 
    I've put this on the TO DO list to get done early next year.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. mail_options and template problems
    By middric in forum FormMail Subscription Support
    Replies: 1
    Last Post: 09-Jan-2005, 09:29 PM
  2. how do you set templateurl?
    By jloyzaga in forum FormMail Subscription Support
    Replies: 9
    Last Post: 26-Oct-2004, 10:36 AM
  3. Form attachments - encoding issue
    By mark70 in forum FormMail Subscription Support
    Replies: 5
    Last Post: 06-Oct-2004, 08:45 PM
  4. file upload issue - everything else is perfect.
    By baergnat in forum FormMail Subscription Support
    Replies: 3
    Last Post: 20-Sep-2004, 09:02 PM
  5. Help with mail_options and conditions
    By wufpack00 in forum FormMail Subscription Support
    Replies: 2
    Last Post: 06-Jul-2004, 01:49 AM

Bookmarks

Posting Permissions

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