Extension:FormMailer

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki extensions manual
Crystal Clear action run.svg
FormMailer
Release status: stable
Implementation Notify
Description Formats and sends posted forms to email recipients.
Author(s) User:Nad
Latest version 1.0.3 (2011-01-02)
MediaWiki 1.6.x and above
License No license specified
Download FormMailer extension
Translate the FormMailer extension if it is available at translatewiki.net
Check usage and version matrix.

The FormMailer extension allows forms in the wiki to be sent to a specified list of recipients. This is useful for people using their MediaWiki to maintain website content who wish to have inquiry forms in the site. This extension only handles the sending of the data in the form, but does not offer any means to create forms, for that you can use Extension:Simple Forms.

Installation[edit]

The extension is a single script which you can obtain from FormMailer extension and save into your extensions directory and include in your LocalSettings.php file as in the following example,

include( "$IP/extensions/FormMailer.php" );

Usage[edit]

Any standard form can be mailed with this extension, all that needs to be done is to ensure that the form contains a value called "formmailer" in it. As long as a value of that name is posted, the formmailer will know that the data from the form is to be sent. The name of this special variable can be set to something else in the $wgFormMailerVarName global configuration variable.

Configuration[edit]

Configuration of this extension is done via two global variables which can be set in your LocalSettings file after the include of the FormMailer.php script.

Variable Default value Meaning
$wgFormMailerRecipients empty list A list of email addresses which should receive posted forms.
$wgFormMailerVarName formmailer If a variable of this name is posted, the data is assumed to be for mailing.
$wgFormMailerFrom formmailer The FROM field in the mailed forms.
$wgFormMailerDontSend list of title, action The items in this list are considered as part of the environment and are not included in the mailed data.
$wgFormMailerMessage Thanks, your enquiry has been submitted! Message to display after sending the form (can also be set in the form by posting formmailer_message.
$wgFormMailerSubject Form submitted from SiteName Message to display after sending the form (can also be set in the form by posting formmailer_subject.
$wgFormMailerAntiSpam true Adds some JavaScript which runs after page load to prevent spambots posting the form.

See also[edit]

  • Extension:EmailPage - Send fully rendered articles with embedded CSS to users, groups or contact lists