+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: Receipt Form Question

  1. #1
    Join Date
    Aug 2009
    Posts
    21

    Default Receipt Form Question

    Hello everyone,

    I want to create a form that will send out receipt information to a designated email address. I want to be able to enter in the email address that the information should go to. Couple fields sent formatted to look nice to a client. The form would be in a restricted part of my web server.

    Is this possible with formmail?

    Thanks.
    Dan

  2. #2
    Join Date
    Jun 2009
    Location
    Houston
    Posts
    378

    Post Re: Receipt Form Question

    Yes, formmail can do this. You will need to setup the form to autorespond. A response will be sent to the e-mail address entered in the form. You can customize the e-mail that is sent with an html template.

    You can learn how here:

    http://www.tectite.com/fmhowto/autorespond.php

  3. #3
    Join Date
    Aug 2009
    Posts
    21

    Default Re: Receipt Form Question

    Thank you for responding so quick. Using the auto respond feature - is this a security risk for spam bots etc..
    And i assume my template will be able to format the email the way that I want it too?

    Dan

  4. #4
    Join Date
    Jun 2009
    Location
    Houston
    Posts
    378

    Post Re: Receipt Form Question

    This risk is minimized with the use of image verification on the form (CAPTCHA).

    I think you also said the form was in a restricted area. So, if you have to have a username and password to even get to the form then the risk is even less.

  5. #5
    Join Date
    Aug 2009
    Posts
    21

    Default Re: Receipt Form Question

    I am having some problems getting the auto responder setup properly. I have my form setup and an email is being sent to my recipient(me) in the form using my plain text template. All works great. But when i type a new email address into my form ($email) the data is not being sent to this new email address, it is only being sent to the recipient listed in my form code.

    Am I doing something wrong? I want to be able to type any email address intothe form field and the data be sent to them. (like a receipt) I am not able to add these addresses to the target_email in the formmail.

    Is this still possible?

    Dan

  6. #6
    Join Date
    Jun 2009
    Location
    Houston
    Posts
    378

    Post Re: Receipt Form Question

    Yes, that is the purpose of autoresponder. Did you setup a plain or html template for the response? You also need a hidden field on your form similar to below. You should also be using CAPTCHA.

    Code:
    <input type="hidden" name="autorespond" value="HTMLTemplate=user_results.htm, Subject=Your HAPA Recruitment Confirmation" />
    If you have all of this and it still does not work, send a link to your form.

  7. #7
    Join Date
    Aug 2009
    Posts
    21

    Default Re: Receipt Form Question

    Thank you for getting back to me. Yes, I have all that done. My form is in a restricted area.

    I have another form on the website that works great. Right now when i click submit, the email goes to webmaster@hhtd.ca but nothing goes to the email address i type into the textbox.

    My templates directory is just "Templates" and that part actually works. PRoblem is the email textbox.

    I will post the code instead. Thanks for looking, I really appreciate it:

    -------------------------------------------------
    <!-- form start -->
    <!-- STEP 1: Put the full URL to formmail.php on your website in the 'action' value. -->
    <form method="post" action="http://www.hhtd.ca/hhtdreceiptfm.php" name="HHTDCreateReceiptForm" onSubmit="return checkRegForm();">
    <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER">
    <!-- STEP 2: Put your email address in the 'recipients' value.
    Note that you also have to allow this email address in the
    $TARGET_EMAIL setting within formmail.php!
    -->
    <input type="hidden" name="recipients" value="webmaster_*^*_hhtd.ca" />
    <input type="hidden" name="good_url" value="http://hhtd.ca/online_register_complete.htm" />
    <!-- STEP 3: Specify required fields in the 'required' value -->
    <input type="hidden" name="required" value="email:Your email address,realname:Players nameimgverify:Image verification Incorrect" />
    <!-- STEP 4: Put your subject line in the 'subject' value. -->
    <input type="hidden" name="subject" value="HHTD Online Receipts" />

    <input type="hidden" name="autorespond" value="PlainTemplate=receiptEmailTemplate.txt,Subject=Your confirmation,TemplateMissing=" />

    <table border="1" cellspacing="5%" width="98%">
    <tr>
    <td>
    Invoice Number:
    </td>
    <td><input type="text" name="invoicenumber" size="10" style="background-color: #FFFFCC" />
    </td>
    </tr>
    <tr>
    <td>
    Invoice Date:
    </td>
    <td><input type="text" name="invoicedate" size="15" style="background-color: #FFFFCC" />
    </td>
    </tr>
    <tr>
    <td>
    Players name:
    </td>
    <td><input type="text" name="realname" size="30" style="background-color: #FFFFCC" />
    </td>
    </tr>
    <tr>
    <td>
    Parents name:
    </td>
    <td><input type="text" name="parentsname" size="30" style="background-color: #FFFFCC" />
    </td>
    </tr>
    <tr>
    <td>
    Email Address:
    </td>
    <td><input type="text" name="email" size="30" style="background-color: #FFFFCC" />
    </td>
    </tr>
    <tr>
    <td>
    Registered Program:
    </td>

    <td>
    <select name="program">
    <option value="Please select a program">Please select a program</option>
    <option value="Sunday Morning Package - Bronze - Fall Sessions - P/$25 - G/$30">Sunday Morning Package - Bronze - Fall Sessions - P/$25 - G/$30</option>
    <option value="Sunday Morning Package - Silver - Fall Sessions - P/$90 - G/$135">Sunday Morning Package - Silver - Fall Sessions - P/$90 - G/$135</option>
    <option value="Sunday Morning Package - Gold - Fall Sessions - P/$150 - G/$235">Sunday Morning Package - Gold - Fall Sessions - P/$150 - G/$235</option>
    <option value="Summer 5 on 5 League - July to August - $120">Summer 5 on 5 League - July to August - $120</option>
    <option value="Powerskating Program - July to August - $140">Powerskating Program - July to August - $140</option>
    <option value="Goaltender Program - July to August - $180">Goaltender Program - July to August - $180</option>
    <option value="Goalie / Player Hockey School - Aug 10-14 - P/$350 - G/$450">Goalie / Player Hockey School - Aug 10-14 - P/$350 - G/$450</option>
    <option value="Hockey School - Aug 17-21 - P/$350 - G/$450">Hockey School - Aug 17-21 - P/$350 - G/$450</option>
    <option value="Hockey School - Aug 24-28 - P/$350 - G/$450">Hockey School - Aug 24-28 - P/$350 - G/$450</option>
    <option value="Hockey School - Aug 31-Sept 4 - P/$350 - G/$450">Hockey School - Aug 31-Sept 4 - P/$350 - G/$450</option>
    <option value="Body Checking Clinic - Aug 21-23 - $150">Body Checking Clinic - Aug 21-23 - $150</option>
    <option value="Bantam/Midget Conditioning Camp - July to August - $225">Bantam/Midget Conditioning Camp - July to August - $225</option>
    <option value="Bantam/Midget Pre Tryout Camp - August - $200">Bantam/Midget Pre Tryout Camp - August - $200</option>
    <option value="Hockey/Golf Camp - Aug 4-7 - $425">Hockey/Golf Camp - Aug 4-7 - $425</option>
    <option value="Team Session">Team Session</option>
    </select>
    </td>
    </tr>
    <tr>
    <td valign="top">
    Mailing Address:
    </td>
    <td><textarea name="address" rows="4" cols="40"></textarea>
    </td>
    </tr>
    <tr>
    <td>
    Home Phone (###-###-####):
    </td>
    <td><input type="text" name="homephone" style="background-color: #FFFFCC" />
    </td>
    </tr>
    <tr>
    <td>
    Type / Method of Payment:
    </td>

    <td>
    <select name="paymentmethod">
    <option value="Please select a method of payment">Please select a method of payment</option>
    <option value="Cheque - Full Payment">Cheque - Full Payment</option>
    <option value="Cash - Full Payment">Cash - Full Payment</option>
    <option value="Cheque - 50% at regstration, 50% due first date of program">Cheque - 50% at regstration, 50% due first date of program</option>
    </td>
    </tr>
    <tr>
    <td>
    Payment Amount:
    </td>
    <td><input type="text" name="paymentamount" size="10" style="background-color: #FFFFCC" />
    </td>
    </tr>
    <tr>
    <td>
    Payment Date Received:
    </td>
    <td><input type="text" name="paymentdatereceived" size="15" style="background-color: #FFFFCC" />
    </td>
    </tr>
    </table>
    <br />

    <table border="1" cellspacing="5%" width="98%">
    <tr>
    <td colspan="2">To submit this form, please enter the characters you see in the image below:</td>
    </tr>
    <tr>
    <td width="50%"><img src="http://www.hhtd.ca/verifyimg.php" align="left" valign="middle" alt="Image verification" name="vimg" /></td>
    <td><input type="text" align="left" valign="middle" size="12" name="imgverify" style="background-color: #FFFFCC" /></td>
    </tr>
    <tr>
    <td colspan="2" align="center"><input type="submit" value="Submit Registration" />
    <input type="reset" value="Clear Form" /></td>
    </tr>
    </table>
    </form>

  8. #8
    Join Date
    Jun 2009
    Location
    Houston
    Posts
    378

    Post Re: Receipt Form Question

    I don't see anything really apparent other than you seem to be missing a comma in required field specification but that is not causing this problem.

    Verify that your template is really called receiptEmailTemplate.txt (make sure the punctuation is correct).

    Try setting arverify=imgverify in a derived field. I believe imgverify is required for captcha to work and arverify is required for autorespond to work.

    Is the other form that is autoresponding in the restricted area?
    Last edited by jzieba; 15-Aug-2009 at 11:07 PM. Reason: correction

  9. #9
    Join Date
    Aug 2009
    Posts
    21

    Default Re: Receipt Form Question

    I am so sorry for being difficult. I am new to PHP but I do know the basics. I have looked and looked and tested but for some reason cannot get this to work. I know it must be something small. I already have a form on the site that works perfect but doesn't use any templates. (The template part is not working properly either right now on this form)

    Here is the link to the form that does not work properly. It is usually hidden but i openned it for anyone that can help me.

    http://hhtd.ca/createReceipt.php

    Here is what is in my formmail

    $TARGET_EMAIL = array(EMAIL_NAME."@hhtd\.ca$");


    $TEMPLATEDIR = "http://www.hhtd.ca/Templates"; // directory for template files; empty string
    // if you don't have any templates

    $TEMPLATEURL = "http://www.hhtd.ca/Templates/receiptEmailTemplate.txt"; // default; no template URL

    All spelling is proper for file names.

    Currently the form is sending the details to my recipient email like the following: (Below is what i typed into the form)

    email: gamerz4life@rogers.com
    realname: Sarah
    invoicenumber: 1000
    invoicedate: Aug 20, 2009
    parentsname: Dan
    program: Powerskating Program - July to August - $140
    paymentmethod: Cheque - Full Payment
    paymentamount: $140.00
    paymentdatereceived: Aug 20, 2009

    ==================================

    REMOTE_HOST=
    REMOTE_ADDR=
    HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 3.0.30729)
    REMOTE_USER=

    This is my plain text email template (very simple for now)

    Thanks for your form submission!
    You submitted this information to us:
    Your name: $realname
    Email: $email

    Please if you could help me get this going i would be very grateful!
    Thank you

    Dan

  10. #10
    Join Date
    Jun 2009
    Location
    Houston
    Posts
    378

    Post Re: Receipt Form Question

    Your TEMPLATE_DIR is not correct. This should not be a url. You can try leaving it empty and just using TEMPLATE_URL.

    TEMPLATE_URL should not have the template name in it as you have it. You specified the template name on the form. Here is an example of template_url.
    Code:
    $TEMPLATEURL = "http://www.mysite.com/templates";
    If you use TEMPLATE_DIR it takes precedence so leave it empty if you want to use the url.

+ 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. Newbie question on open_basedir error
    By zenprofit in forum FormMail Subscription Support
    Replies: 14
    Last Post: 14-Feb-2005, 10:35 PM
  2. question about PHP version 4.3.8
    By djgotee in forum FormMail Subscription Support
    Replies: 4
    Last Post: 29-Nov-2004, 12:46 AM
  3. TARGET_EMAIL question
    By middleburyman in forum FormMail Subscription Support
    Replies: 1
    Last Post: 03-Sep-2004, 09:30 PM
  4. Uploading question
    By tray in forum FormMail Subscription Support
    Replies: 2
    Last Post: 11-Aug-2004, 10:31 PM
  5. at mangle / e-mail question
    By Ibis in forum FormMail Subscription Support
    Replies: 3
    Last Post: 25-Feb-2004, 03:59 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