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!

Subscription Form Processing with Master Form V4

Master Form V4; one that email list publishers could find very useful is subscription form processing.

The purpose of this form is to record the subscription information from your website and then send it to the list software or service. It will work with any software or service that accepts emailed subscriptions.

Someone provides their email address (and name and other information, depending on the form you use). They click the form's submit button.

When the form is submitted to Master Form V4, it takes these steps:

  1. Updates a database with the submitted information.

  2. Sends a subscription email to the list software/service. (The list software/service then handles the subscription after it receives the email.)

  3. Sends an email to the new subscriber.

  4. Sends an email to you, the webmaster.

  5. Presents a "thank you" page to the new subscriber.

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.

Subscription 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,name">
<input type="hidden" name="emailfields" value="email">
<input type="hidden" name="dbfile" value="data/singleoptin_subscribers.csv">
<input type="hidden" name="filetemplate" value="templates/singleoptin_subscriberdata.txt">
<input type="hidden" name="emailtemplate" value="templates/singleoptin_subscriptionemail.txt">
<input type="hidden" name="emailtemplate" value="templates/singleoptin_subscriberemail.txt">
<input type="hidden" name="emailtemplate" value="templates/singleoptin_webmasteremail.txt">
<input type="hidden" name="flowto" value="/singleoptin_confirmation.html">
<p>
Your email address: 
<input type="text" name="email" style="width:200px;">
</p>
<p>
Your 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.

Your email address:

Your name:

Following is a short explanation of each hidden field, along with an example if the hidden field refers to a template.

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"

The file name and location of the database is specified here. 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 prepared 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]]"

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

  • the server date,
  • the server time,
  • the email address provided on the form,
  • the name provided on the form, and
  • the IP address of the form user.

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

Hidden field name="emailtemplate" (three)

Three email templates are used — for the list software/service, for the new subscriber, and for you, the webmaster.

Here is an example email template for the list software/server:

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

Subscribe [[email]]

You'll notice the versatile [[if...]] ... [[/if_...]] placeholder pair in the template. As used above, the form user's name will be printed if information was provided in the name="name" form field — having the name optional in the subscription form would be an example of the placeholder pair in used.

Here is an example email template for the new subscriber:

To: [[email]]
From: "Ezine LLC" <ezine@example.com>
Subject: Your Ezine subscription has been entered

Welcome aboard!

To show our appreciation, we're making available ...

Thank you!

Webmaster
Ezine LLC

Here is an example email template to be sent to you, the webmaster:

From: [[email]]
To: webmaster@example.com
Subject: Opt-In Subscription!

This was submitted:

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

IP Address [[IP]]

If you prefer to have a copy of the email being sent to the list software/service instead of (or in addition to) the webmaster email, the list software/service email can have a Bcc: line added to it. Here is an example:

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]]

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>

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

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