eMail Form and Membership Registration
Want to have a form that visitors fill out and gets sent to your staff ?
Ah yes, & while we're at it why don't we register the individual as a member to the site so s/he can receive bulletins.
addedValues to the rescue ! With an appropriate postprocessor (or if you prefer a script that handles all this data acquisition and entry in what addeValues calls transactions), this can be fully controlled and managed. To do so however, the postProcessor must be enabled on the server; only your server manager can do so through Manila's control panel. On the AddedValues sub-page, do the following sequence :

- select the emailForm postprocessor in modify menu
- click on Modify Post Processor
- the action script will appear, as will a check box to enable. Check it
- click Modify Post Processor anew
To start things off, you are going to have to define the variables you need:
| Mandatory fields for eMailing of form |
Optional fields for eMailing of form |
Mandatory fields for registering membership |
mailTo mailSubject mailBodyTemplate |
mailSender mailReplyTo mailCC mailBCC mailMimeType confirmMailBodyTemplate |
mailReplyTo memberAutoEnter memberName memberBulletins memberHTMLBulletins |
To
define your variable, there are the following steps to follow:
| 1 | addedValues has already create a global variable which you will now use: variable groupnames. |  |
| 2 | Edit its Predefined list to add an item that you want to identify this particular transaction. In this example we have used infoRequest. |  |
| 3 | Create the variables you will be using. Those pointed out in the table above + any other that you will want filled out on the form. They must Apply to: User Transactions They will accordingly appear in the list of variables under the heading Transactions |  |
| 4 | Now define each of these variables. They must be assigned to a group which matches the predefined element that identifies this transaction (inforequest) As well, for users to be able to actually enter in some data, variables mailReplyTo and mailSender must be modifiable by everybody. The other variables such as mailTo can (and should if you wish to mask an eMail address from nasty eMail address scanners) have a default value. If you are going to have multiple CC or BCC addresses, do not define valueMustBe as eMail address but as a string.
mailBodyTemplate must include the name of the report corresponding to the what body you want to send. memberAutoEnter,memberBulletins & memberHTMLBulletins must be boolean if you are going to register the individual as a member to your site.
Note: your variables will now appear in the listing under the heading transactions yourIdentifier, which will make them usable in the coming steps. |
Then, you can go on to defining your forms and reports. Often it may be more convenient to think of the light at the end of the tunnel:
what is is you want to produce? So you may wish to start
defining output reports.
| 1 | A first mandatory report is necessary to define the confirmation message that will appear to the user
|  |
| 2 | A second report lays out the eMail you want to send |
| 3 | If you wish, you can get really sophisticated and layout a report of an eMail as it would be sent, but rendered to the user's browser... |
Now to defining the
input form...
| 1 | You will give your form a name. It must apply to User transaction and you have to assign it the identifier of the transaction you have in mind (in our example infoRequest); Usage is Update. Click on Add, wait until the form refreshes... new useful stuff will appear. Before you go any further, select the report and click on the options button. You can now assign the postProcessor that will apply to the transaction and assign the report that serves as a confirmation message that all the data has been received by the server. Once you've made your decisions, click on Set Options.
|  |
| 2 | You can now define your report as it pleases you... One word however on linguistic versions. AV naturally recognizes boolean values and the fact that they can have labels for true or false values. It assigns in the variable definition Yes or no as working values (and their equivalents in localized versions of Manila). So you can have Ja, SÏ or whatever it is... But you can also give the value a label of your own "Messy HTML stuff" vs "plain ol' ASCII stuff"... Enjoy !
|  |
All done? Almost... Where are you going to place this form? Well David Bayly has perkily prepared three different ways of running this... Using the following macros
- BeginUserTransaction - placed in any ol' page..
- BeginUserTransactionLink - as its name says...
- BeginUserTransactionLinkPopup - oooohh... I can have it popUp at my folks!
Click on the
macros link in the reference section to the left to find out what you can do with each. Pretty sophisticated stuff...
& if you need more postProcessors that do this kind of stuff, he's the guy to commission (no David did not write these words, did not pay me to do so, nor even suggested it...)