|
WebKeystone Example 8: Creating a form letter
The Form
The Files
<FORM METHOD="POST" ACTION="/wkstone/webkeystone.py">
<INPUT TYPE="HIDDEN" NAME="UserID" VALUE="biz_webkeystone">
<INPUT TYPE="HIDDEN" NAME="Profile" VALUE="examples/example8.prof"><CENTER>
<TABLE BORDER="1" CELLPADDING="5" CELLSPACING="0" WIDTH="90%" BGCOLOR="#FFFFCC" COLS="2">
<TR>
<TD>
<P>
<TABLE BORDER="0" WIDTH="90%">
<TR>
<TD ALIGN="LEFT" COLSPAN="2">
<P ALIGN="LEFT"><FONT SIZE="4" COLOR="#000000"><B>Creating a form letter</B></FONT>
<p>This form is designed to get you out of the trouble you've gotten into. Whenever there's a multiple choice, pick the one that works best for your situation and use it. </p>
<p>Dear
<select name="D1" size="1">
<option>Mom</option>
<option>Dad</option>
<option>love of my life</option>
<option>Assistant Principal</option>
<option>Local Police Chief</option>
<option>Glenn</option>
</select> </p>
<p>Words cannot begin to express how sorry I am that your <select
name="D2" size="1">
<option>car</option>
<option>house</option>
<option>pet</option>
<option>espresso maker</option>
<option>left arm</option>
</select></p>
<p>was severely damaged by my <select name="D3" size="1">
<option>infantile</option>
<option>puerile</option>
<option>inept</option>
<option>comically brilliant but nonetheless sadistic</option>
<option>woefully under appreciated </option>
</select> prank. </p>
<p>How could I have known that the <select name="D4" size="1">
<option>car</option>
<option>jet ski</option>
<option>large helium balloon</option>
<option>rodent driven sledge</option>
<option>Zamboni</option>
<option>dolly (the kind with which you move furniture)</option>
</select></p>
<p>I was riding would go so far out of control? And while it
is true that I should not have pointed it in the direction of
your <select name="D5" size="1">
<option>house</option>
<option>wife</option>
<option>Cub Scout troop</option>
<option>1/16th sized replica of the Statue of Liberty, complete with lightbulb in the torch</option>
<option>priceless collection of Rolling Rock beer cans</option>
<option>newly acquired Mercedes</option>
</select>,</p>
<p>you must understand that it was all meant in fun. The
subsequent carnage that I caused is beyond my ability to <select
name="D6" size="1">
<option>imagine</option>
<option>fathom</option>
<option>comprehend</option>
<option>appreciate</option>
<option>pay for</option>
</select>,</p>
<p>and I must therefore humbly ask your forgiveness. I know
that you are perfectly within your rights to <select
name="D7" size="1">
<option>hate me</option>
<option>sue me</option>
<option>spank me</option>
<option>take my firstborn</option>
<option>gouge out my eyes with spoons and feed them to the fish in your koi pond</option>
<option>donate my payroll check to the charity of your choice</option>
</select>,</p>
<p>but I ask you to remember all the good times we've had,
joshing around at <select name="D8" size="1">
<option>school</option>
<option>work</option>
<option>church</option>
<option>the bowling alley</option>
<option>the municipal jail</option>
<option>Cherry Creek Sporting Club</option>
</select></p>
<p>, and to remember that I am first and foremost your <select
name="D9" size="1">
<option>friend</option>
<option>child</option>
<option>sibling</option>
<option>lease co-signer</option>
<option>only possible match should you ever need a bone marrow transplant</option>
<option>employee from which a servant clone is most likely to be created</option>
</select>.</p>
<p> </p>
<p>I think that counts for more than one prank, especially
one that <select name="D10" size="1">
<option>was so stupid</option>
<option>was so silly</option>
<option>would have been funny if it worked</option>
<option>you would have done, if you had thought of it first</option>
<option>I'm going to use again on someone else</option>
</select>.</p>
<p> </p>
<p>Sincerely,</p>
<p>enter your name<input type="text" size="20" name="name"> <br>
the email address to send to <input type="text" size="20"
name="to_email.req.vEmail"> </p>
<p><input type="submit" value="Send"> </p>
# Profile for Example 8
IF MissingReq
RETURN 'examples/example8Missing.html'
IF ErrorVal
RETURN 'examples/example8Invalid.html'
MAIL
SUBJECT 'Sorry'
FROM 'example8@webkeystone.com'
TO to_email
BODY 'examples/example8Mail.txt'
RETURN 'examples/example8Bye.html'
<HTML><BODY> The following was sent to %(to_email)s on behalf of %(name)s. <P> <HR> <P> Dear %(D1)s, <P> Words cannot begin to express how sorry I am that your %(D2)s was severely damaged by my %(D3)s prank. How could I have known that the %(D4)s I was riding would go so far out of control? And while it is true that I should not have pointed it in the direction of your %(D5)s, you must understand that it was all meant in fun. <P> The subsequent carnage that I caused is beyond my ability to %(D6)s, and I must therefore humbly ask your forgiveness. I know that you are perfectly within your rights to %(D7)s but I ask you to remember all the good times we've had, joshing around at %(D8)s, and to remember that I am first and foremost your %(D9)s. <P> I think that counts for more than one prank, especially one that %(D10)s. <P> Sincerely,<P> %(name)s </BODY></HTML> |
template = '<LI> %(1)s' #--------------------------- <HTML><BODY> <TABLE BGCOLOR="#FFFFFF" BORDER=3 COLS=1 CELLPADDING=3 WIDTH=600> <TR> <TD> <FONT COLOR="#001177"> <FONT SIZE="+1">The following fields were left blank:</FONT> <UL> %(MissingReq,template)s </UL> <FONT SIZE="+1">Please go back and fill them in. Thank you!</FONT> </FONT> </TD> </TR> </TABLE> </BODY></HTML> |
template = '<LI> %(1)s' #--------------------------- <HTML><BODY> <TABLE BGCOLOR="#FFFFFF" BORDER=3 COLS=1 CELLPADDING=3 WIDTH=600> <TR> <TD> <FONT COLOR="#001177"> <FONT SIZE="+1">The following fields were filled in incorrectly:</FONT> <OL> %(ErrorVal,template)s </OL> <FONT SIZE="+1">Please go back and correct the errors. Thank you!</FONT> </FONT> </TD> </TR> </TABLE> </BODY></HTML> |
Dear %(D1)s, Words cannot begin to express how sorry I am that your %(D2)s was severely damaged by my %(D3)s prank. How could I have known that the %(D4)s I was riding would go so far out of control? And while it is true that I should not have pointed it in the direction of your %(D5)s, you must understand that it was all meant in fun. The subsequent carnage that I caused is beyond my ability to %(D6)s, and I must therefore humbly ask your forgiveness. I know that you are perfectly within your rights to %(D7)s but I ask you to remember all the good times we've had, joshing around at %(D8)s, and to remember that I am first and foremost your %(D9)s. I think that counts for more than one prank, especially one that %(D10)s. Sincerely, %(name)s |
| Previous Example | Next Example | Table of Contents |
Updated 2-August-99
|
|
|
|
|
| WebKeystone is a product of Townsend Software, Inc. ©1998 - 2001 Townsend Software, Inc. All rights reserved. |