Master Form V4">
Software, your way.
How To Get Good Custom Software
(Download)
(PDF)
burger menu icon
WillMaster

WillMaster > LibraryOur Software in Action >  >Master Form V4 in Action

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Multiple Ezine Subscription Form Processing with Master Form V4

Master Form V4 can process many different kinds of forms.

One type of form ezine publishers will find useful allows a site visitor to subscribe to multiple ezines with one form.

This article is a how-to for multiple ezine subscription processing. It is a modified version of the "Subscription Form Processing with Master Form V4" article (listed with others in the "Related Articles" box on the right). NOTE: This form provides the means for subscribing, only.

Site visitors provide their email address (and name and other information, depending on the form you use). And they check the ezines they want to subscribe to. Then, Master Form V4 takes these steps:

  1. Updates a database with the submitted information.

  2. Sends a subscription email to the list software/service of each ezine the site visitor checked. (The list software/services then handle the subscriptions.)

  3. Sends an email to you, the webmaster.

  4. Presents a "thank you" page to the form user.

Forms, emails, databases, and "thank you" pages can all be formatted the way you want and contain the information you want.

I'll show you how to do it, step by step. If anything is unclear, or if you wish to modify the examples provided here, please consult the Master Form V4 Manual.

Multiple List Building with Master Form V4

First, make the form. Here is an example form you can use:

<form method="POST" action="/cgi-bin/mfv4/MasterFormV4.cgi">
<input type="hidden" name="requiredfields" value="email">
<input type="hidden" name="emailfields" value="email">
<input type="hidden" name="dbfile" value="data/multioptin_subscribers.csv">
<input type="hidden" name="filetemplate" value="templates/multioptin_subscriberdata.txt">
<input type="hidden" name="emailtemplate" value="templates/multioptin_webmasteremail.txt">
<input type="hidden" name="flowto" value="/multioptin_confirmation.html">
<p>
<h3>Check the ezines that interest you!</h3>
</p>
<p>
<input type="checkbox" name="emailtemplate" value="multioptin_ezine1_subscriptionemail.txt"> 
<b>The First Ezine</b><br>
This is the first and the best — always has been, is now, and always will be.
</p>
<p>
<input type="checkbox" name="emailtemplate" value="multioptin_ezine2_subscriptionemail.txt"> 
<b>The Almost Ezine</b><br>
This one is almost as good. If you like "The First Ezine," you'll like this one, too.
</p>
<p>
<input type="checkbox" name="emailtemplate" value="multioptin_ezine3_subscriptionemail.txt"> 
<b>Possibilities</b><br>
No matter what the others say, this is the best. Nearly 300 weekly issues have been published since July 1999, and we're still going strong. It's the resource you can't do without.
</p>
<p>
Email: 
<input type="text" name="email" style="width:200px;">
</p>
<p>
Name: 
<input type="text" name="name" style="width:200px;">
</p>
<p>
<input type="submit">
</p>
</form>

Verify the URLs in the FORM tag and the hidden fields are correct. Adjust as necessary.

Here is how the above form would print on your web page.

Check the ezines that interest you!

The First Ezine
This is the first and the best — always has been, is now, and always will be.

The Almost Ezine
This one is almost as good. If you like "The First Ezine," you'll like this one, too.

Possibilities
No matter what the others say, this is the best. Nearly 300 weekly issues have been published since July 1999, and we're still going strong. It's the resource you can't do without.

Email:

Name:

The Hidden Form Fields

Below is a short explanation of each hidden field. If the hidden field refers to a template, an example is provided.

Hidden field name="requiredfields"

This hidden field's value contains a comma-separated list of the field names that are required to contain information before the form can be successfully submitted.

Hidden field name="emailfields"

This hidden field's value contains a comma-separated list of the field names that must contain a correctly formatted email address if they contain any information at all.

Hidden field name="dbfile"

Here is where the file name and location of the database is specified. Information submitted with the form is appended to the file, the file created if it doesn't already exist.

Hidden field name="filetemplate"

The template specified in this hidden field is used to prepare the data record prior to appending to the database file. Here is an example database record template:

**INITIALIZE_DATABASE_WITH_FIELD_NAMES**
"[[WEEKDAY]], [[LONGMONTH]] [[DAY]], [[YEAR]]","[[HOUR2]]:[[MINUTE2]]:[[SECOND2]]","[[email]]","[[name]]","[[IP]]","[[emailtemplate SeparateWith(%0A)]]"

The above is a template for a comma-separated values (CSV) file, recording.

The first line of the template tells Master Form V4 to print the first record with field names whenever it creates a new database file.

The next line is the template for the data record. It provides for fields for —

  • the server date,
  • the server time,
  • the email address provided on the form,
  • the name provided on the form,
  • the IP address of the form user, and
  • the names of the email template files that were used (a separate template is used for each ezine).

The last field records the file names of the webmaster email template and the email template of each ezine checked when the form was submitted. The template file names are separated with %0A ("0A" is the hex number for a line feed character, and the "%" preceding the hex number tells some programs to convert the hex number). A different separator may be specified. See the Master Form V4 Manual for more information.

Hidden field name="emailtemplate"

This email template is for you, the webmaster. (The email templates for the ezines are specified as the values of the ezine checkbox fields.)

Here is an example email template for the webmaster:

From: [[email]]
To: webmaster@example.com
Subject: Multi-List Subscription!

This was submitted:

[[if_name]]Name: [name]][[/if_name]]
Email: [[email]]

IP Address [[IP]]

Email template files used:
     ~~ [[emailtemplate SeparateWith(
     ~~ )]]

Hidden field name="flowto"

If you do not wish to have the "thank you" page personalized, use hidden field name="redirect" instead of name="flowto"

When hidden field name="flowto" is used, Master Form V4 retrieves the template web page at the URL, personalizes/customizes it, then displays the modified web page in the user's browser.

Here is an example "thank you" web page template:

<html>
<body>
<p>
Your subscription has been accepted[[if_name]], [[name]][[/if_name]].
</p>
<p>
It is is recorded as [[email]]
</p>
</body>
</html>

The Visible Form Fields

The visible form fields are the checkboxes, the text fields, and the submit button.

The field names of the ezine checkboxes are all name="emailtemplate"

You'll note that is the same field name as the hidden field that specifies which template to use when sending the webmaster email.

When an ezine checkbox is checked, the checkbox is added to the name="emailtemplate" values list. The value of the checkbox is the location of the email template to use when subscribing to that particular ezine. (When the form is submitted, Master Form V4 constructs and sends an email for each template in the name="emailtemplate" values list.)

Here is an example email template that might be sent to the ezine software/service when the form user checks a checkbox. The example includes a Bcc: line for the webmaster to receive a copy.

Return-Path: <[[email]]>
From: [[if_name]]"[name]]" [[/if_name]]<[[email]]>
Reply-To: [[if_name]]"[name]]" [[/if_name]]<[[email]]>
To: listserver@example.com
Bcc: webmaster@example.com
Subject: Subscribe [[email]]

Subscribe [[email]]

Implementation

Put the web page form on your server, and the templates in the locations specified in the form's hidden fields

Then test it. Verify that all emails are sent and the database is updated.

When it works the way you want it to, and you're ready to do so, put the form on a publicly accessible web page and link to it.

Will Bontrager

Was this article helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method

All information in WillMaster Library articles is presented AS-IS.

Support Area – Ask Your Question Here

The "Code in articles help" forum at the Willmaster.com support area is the place to get information about implementing JavaScript and other software code found on Willmaster.com

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

Need Custom Software?
Click to
tell us about
your project.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List
software index page

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2024 Will Bontrager Software LLC