Extension:FormMailer

From Linux Web Expert

MediaWiki extensions manual
FormMailer
Release status: unmaintained
Implementation Notify
Description Formats and sends posted forms to email recipients
Author(s) Aran Dunkley (Nadtalk)
Latest version 1.0.11 (2018-04-20)
MediaWiki 1.23+
License GNU General Public License 2.0 or later
Download FormMailer extension

  • $wgFormMailerRecipients
  • $wgFormMailerVarName
  • $wgFormMailerFrom
  • $wgFormMailerDontSend
  • $wgFormMailerMessage
  • $wgFormMailerSubject
  • $wgFormMailerAntiSpam
Quarterly downloads Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').
Public wikis using Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin').

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.

Installation

  • <translate> <tvar name=1>Copy the code into files</tvar> and place the file(s) in a directory called <tvar name=name>FormMailer</tvar> in your <tvar name=ext>extensions/</tvar> folder.</translate>
  • <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
    require_once "$IP/extensions/FormMailer/FormMailer.php";
    
  • Configure as required.
  • File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>

Usage

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

Here are the parameters which affect the operation of the extension. These should be set in your "LocalSettings.php" file after invoking the extension.

Variable Default value Meaning
$wgFormMailerRecipients [] 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 'wiki@' . preg_replace( '|^.+www\.|', '', $wgServer ) The FROM field in the mailed forms.
$wgFormMailerDontSend [ 'title', 'action', 'debug', 'uselang', 'useskin' ] 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 submicodeed 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 from posting the form.

See also

  • Extension:EmailPage - Allows sending fully rendered articles with embedded CSS to users, groups, or contact lists
  • Extension:CIForms - Forms with auto-validation, multiple choice questions and cloze tests