NAME

CGI::WPM::MailForm - Perl module that is a subclass of CGI::WPM::Base and implements an e-mail submission form with unlimited questions.

DEPENDENCIES

Perl Version

5.004

Standard Modules

I<none>

Nonstandard Modules

CGI::WPM::Base 0.33
CGI::WPM::Globals 0.33
HTML::FormTemplate 1.02
CGI::MultiValuedHash 1.03
CGI::WPM::SequentialFile 1.03 (optional)

SYNOPSIS

Shortest Complete MailForm Program -- Uses Default Question

my %CONFIG = ();

require CGI::WPM::Globals;
my $globals = CGI::WPM::Globals->new();

$globals->site_title( 'Sample Web Site' );  # use this in e-mail subjects
$globals->site_owner_name( 'Darren Duncan' );  # send messages to him
$globals->site_owner_email( 'darren@sampleweb.net' );  # send messages here

require CGI::WPM::MailForm;
$globals->move_site_prefs( \%CONFIG );
CGI::WPM::MailForm->execute( $globals );

$globals->send_to_user();

Use Custom Questions Defined Here

my %CONFIG = (
	custom_fd => 1,
	field_defn => [
		{
			visible_title => "What's the combination?",
			type => 'checkbox_group',
			name => 'words',
			'values' => ['eenie', 'meenie', 'minie', 'moe'],
			default => ['eenie', 'minie'],
			labels => [qw( This That And Another )],
		}, {
			visible_title => "What's your favorite colour?",
			type => 'popup_menu',
			name => 'color',
			'values' => ['red', 'green', 'blue', 'chartreuse'],
		},
	],
);

Use Custom Questions Defined In Perl File

my %CONFIG = (
	custom_fd => 1,
	field_defn => 'survey_questions.txt',  # do Perl code to make array ref
);

Use Custom Questions Defined In SequentialFile File

my %CONFIG = (
	custom_fd => 1,
	field_defn => 'survey_questions.txt',  # file in SequentialFile format
	fd_in_seqf => 1,
);

Customize Subject Of Your Emails

my %CONFIG = (
	email_subj => 'Another Survey Response',
);

Customize Webpage Intro Text

my %CONFIG = (
	fn_messages => 'guestbook_messages.txt',
	msg_new_title => 'Leave A Message',  # custom title for new messages
	msg_new_head => <<__endquote,   # custom heading for new messages
<H1>Leave A Message</H1>
<P>Please leave a message after the beep.  Answer the questions as faithfully
and truthfully as you can, as we have a lie detector set up and any false 
answers will be met with spam.</P>
__endquote
);

DESCRIPTION

This POD is coming when I get the time to write it.

SYNTAX

This class does not export any functions or methods, so you need to call them using object notation. This means using Class->function() for functions and $object->method() for methods. If you are inheriting this class for your own modules, then that often means something like $self->method().

PUBLIC FUNCTIONS AND METHODS

This module inherits its entire public interface from CGI::WPM::Base. Please see the POD for that module so you know how to call this one.

PREFERENCES HANDLED BY THIS MODULE

This POD is coming when I get the time to write it.

custom_fd   # if true, we use a custom list of 
	# questions in the form; otherwise, we simply have a "message" field.
field_defn  # instruc for how to make form fields
	# If array ref, this is taken literally as list of definitions.
	# Otherwise, this is name of a file containing the definitions.
fd_in_seqf  # if true, above file is of the 
	# format that CGI::WPM::SequentialFile handles; else it is Perl code

email_subj  # if set, use when sending e-mails

msg_new_title  # custom title for new messages
msg_new_head   # custom heading for new messages

AUTHOR

Copyright (c) 1999-2001, Darren R. Duncan. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. However, I do request that this copyright information remain attached to the file. If you modify this module and redistribute a changed version then please attach a note listing the modifications.

I am always interested in knowing how my work helps others, so if you put this module to use in any of your own code then please send me the URL. Also, if you make modifications to the module because it doesn't work the way you need, please send me a copy so that I can roll desirable changes into the main release.

Address comments, suggestions, and bug reports to perl@DarrenDuncan.net.

SEE ALSO

perl(1), CGI::WPM::Base, CGI::WPM::Globals, HTML::FormTemplate, CGI::MultiValuedHash, CGI::WPM::SequentialFile.