+ Reply to Thread
Results 1 to 5 of 5

Thread: PlainTemplate Configuration

  1. #1
    Join Date
    Nov 2007
    Posts
    3

    Default PlainTemplate Configuration

    Hi. I have just started using FormMail and am trying to configure it for future use re submitting forms.

    Would appreciate some assistance with the following, as I have read the How to Guides and forums but still am unable to get some features to work:

    1. Currently when I receive form results they look like:

    email: joebloggs@joebloggs.com
    realname: fseesfsef
    Subject: fdafsefsf
    Message: esfsefsefse
    Date: 21-11-07
    Time: 20:38:09

    So I have created a template so that I can display the results. However, the results still come through as unformatted. I am thinking that maybe I am not putting in the path to the plain.txt file correctly? I have tried many different scenarios with no success.

    Also, is this how to get rid of 'email' and 'realname' by substituting with alternative names in the template?

    2. In the form results emailed to me, the 'From' field displays just the name of the person who filled out the form. Where can I go to configure the information displayed. I would prefer it to show something like 'Contact Form Submission'.

    3. I have successfully managed to setup email validation, however FormMail is not validating emails that include a '-' in the email eg joebloggs@joe-bloggs.com

    Your assistance with the above would be most welcome.


    Thankyou

  2. #2
    Join Date
    Dec 2003
    Posts
    3,900

    Default Re: PlainTemplate Configuration

    Hi,

    Quote Originally Posted by ck101 View Post
    1. Currently when I receive form results they look like:

    email: joebloggs@joebloggs.com
    realname: fseesfsef
    Subject: fdafsefsf
    Message: esfsefsefse
    Date: 21-11-07
    Time: 20:38:09

    So I have created a template so that I can display the results. However, the results still come through as unformatted. I am thinking that maybe I am not putting in the path to the plain.txt file correctly? I have tried many different scenarios with no success.
    The very first thing is to ensure you have DEF_ALERT set and it's working (use testalert feature) so that FormMail can tell you about errors.

    There are 4 steps to getting templates to work:
    1. Create a folder (directory) on your server to hold the templates. Make sure the folder is readable and searchable. On Linux this would be mode rwxr-xr-x or 755. Find out the path of the folder. You can use the "testalert" feature of FormMail to assist or ask your hosting provider.
    2. Put the path of the folder in the $TEMPLATEDIR setting in FormMail.
    3. Upload your template file to the folder.
    4. Use PlainTemplate=filename.txt in the "mail_options" hidden field inside your HTML.
    That's it.

    If you've done all these steps and and still cannot get it to work, please send me access details to your server using this secure form:
    https://secure.rootsoftware.com/~tectite/sendsecret.php

    Quote Originally Posted by ck101 View Post

    Also, is this how to get rid of 'email' and 'realname' by substituting with alternative names in the template?
    Yes, if you're going to use templates then that's the simplest way.


    Quote Originally Posted by ck101 View Post
    2. In the form results emailed to me, the 'From' field displays just the name of the person who filled out the form. Where can I go to configure the information displayed. I would prefer it to show something like 'Contact Form Submission'.
    You really don't want to change the From field. This is important for mail delivery.

    If you want to set the Subject of the email, use "mail_options".

    This documentation will assist:
    http://www.tectite.com/fmdoc/creating_forms.php

    Quote Originally Posted by ck101 View Post
    3. I have successfully managed to setup email validation, however FormMail is not validating emails that include a '-' in the email eg joebloggs@joe-bloggs.com
    OK. There is a post somewhere that shows the right conditions for email validation. But if you've like to post the conditions field you currently have, I'll post back the required change to it.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Nov 2007
    Posts
    3

    Default Re: PlainTemplate Configuration

    Hi Russell

    I have followed your suggestions. With DEF_ALERT activated I now get the error emailed to me which is great, helps to pinpoint the problem. The error states that the directory to plain.txt cant be found. I have tried variations on the path details in $TEMPLATEDIR, however it still does not seem to be working. Hence have sent the access details to you so you can have a look.

    Re the email validation, here is the code I have used:

    <input type="hidden" name="conditions" value=":##TEST#email ~ /^[a-z0-9_.]+@[a-z0-9_]+\.([a-z0-9_.]+)*[a-z0-9_.]$/i #Please enter a valid email address.#" />

    So basically, its working fine aside from the fact that it wont validate email addresses that contain a dash.

    Thankyou

    Conrad
    Last edited by ck101; 22-Nov-2007 at 05:05 AM.

  4. #4
    Join Date
    Dec 2003
    Posts
    3,900

    Default Re: PlainTemplate Configuration

    Hi,

    I've just emailed you regarding the fix to your $TEMPLATEDIR setting.

    For your email conditions you want this:
    HTML Code:
    <input type="hidden" name="conditions" value=":##TEST#email ~ /^[-a-z0-9_.]+@[-a-z0-9_]+\.([-a-z0-9_.]+)*[a-z0-9_.]$/i #Please enter a valid email address.#" />
    That's simply adding a hyphen after the first three [.

    The last [...] section is about matching top-level domains, which don't have hyphens in them, so you don't need to add it there.

    Of course, this just checks the syntax of email addresses, not whether they are actually valid.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #5
    Join Date
    Nov 2007
    Posts
    3

    Default Re: PlainTemplate Configuration

    Thankyou for the quick response Russell. Everything seems to be working ok now.


    Conrad

+ 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. Easier access to configuration options
    By FLEB in forum Your Suggestions
    Replies: 4
    Last Post: 24-Apr-2007, 09:13 AM
  2. PlainTemplate not recognized
    By mbanker13 in forum FormMail Subscription Support
    Replies: 3
    Last Post: 06-Sep-2005, 04:28 AM
  3. PlainTemplate feature - formatting your plain text email
    By russellr in forum HOWTO Guides and Tips
    Replies: 7
    Last Post: 03-Mar-2005, 01:08 PM
  4. Configuration
    By JimHoltan in forum FormMail Subscription Support
    Replies: 14
    Last Post: 23-Nov-2004, 01:20 AM
  5. Installation/Configuration Warnings
    By sebestyen in forum FormMail Subscription Support
    Replies: 2
    Last Post: 08-Oct-2004, 03:36 PM

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