Extension:ContactPage

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png
ContactPage

Release status: stable

Implementation Special page, Hook
Description Provides a contact form for visitors
Author(s) Daniel Kinzler, Sam Reed
Latest version 2.2 (2014-03-26)
MediaWiki 1.23+
PHP 5.3+
Database changes No
License GNU General Public License 2.0 or later
Download
README
Example Contact page - brightbyte.de
Parameters
  • $wgContactConfig

Translate the ContactPage extension if it is available at translatewiki.net

Check usage and version matrix; code metrics

Issues:

Open tasks · Report a bug

The ContactPage extension implements a contact form for visitors. It creates a special page "Special:Contact", which is similar to "Special:EmailUser", but it has a fixed recipient, and may be used anonymously.

Upgrading from versions < 2.x (MediaWiki ≤ 1.22) to versions ≥ 2.x (MediaWiki ≥ 1.23) requires a complete reconfiguration of this extension in "LocalSetting.php" to avoid breakage.

Version ≥ 2.x (MediaWiki ≥ 1.23)[edit | edit source]

Installation[edit | edit source]

  • Download and extract the file(s) in a directory called ContactPage in your extensions/ folder. If you're a developer and this extension is in a Git repository, then instead you should clone the repository using:
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/ContactPage.git
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/ContactPage/ContactPage.php";
$wgContactConfig['default'] = array(
	'RecipientUser' => 'WikiUser', // Must be the name of a valid account
	'SenderName' => 'Contact Form on ' . $wgSitename, // "Contact Form on" needs to be translated
	'SenderEmail' => null, // Defaults to $wgPasswordSender, may be changed as required
	'RequireDetails' => true, // Either "true" or "false" as required
	'IncludeIP' => true, // Either "true" or "false" as required
	'AdditionalFields' => array(
		'Text' => array(
			'label-message' => 'emailmessage',
			'type' => 'textarea',
			'rows' => 20,
			'cols' => 80,
			'required' => true,  // Either "true" or "false" as required
			),
		),
	);
  • See the README file for further options to customize and adapt as it convenes
  • Done! Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.
You can require a CAPTCHA test for the contact page, if you have the ConfirmEdit extension installed. CAPTCHAs are enabled by adding
$wgCaptchaTriggers['contactpage'] = true;
to "LocalSettings.php" below the invocation of both extensions.
Note Note: The integration with the ConfirmEdit extension does not work for the REL1_23 tag. Thus this version has to be used for MW 1.23.x

Version < 2.x (MediaWiki ≤ 1.22)[edit | edit source]

Installation[edit | edit source]

Note Note: Do not use the git clone command for MW-version <= 1.22 !

  • Download and extract the file(s) in a directory called ContactPage in your extensions/ folder. If you're a developer and this extension is in a Git repository, then instead you should clone the repository.
  • Add the following code at the bottom of your LocalSettings.php:
require_once "$IP/extensions/ContactPage/ContactPage.php";
$wgContactUser = 'WikiAdmin'; // Must be the name of a valid account
$wgContactSenderName = 'Contact Form on ' . $wgSitename; // "Contact Form on" needs to be localised

Configuration[edit | edit source]

$wgUserEmailUseReplyTo
determines if visitor's email address will be used as the Reply-To address (failsafe) or the From address (nicer, and default). This is a global option that also controls how MediaWiki behaves for mails between registered users. See Special:MyLanguage/Manual:$wgUserEmailUseReplyTo for more information. Used since rev:37135 (July 2008). Requires MediaWiki 1.12.
$wgContactUser
must be the name of a registered wiki user, who has supplied an email address, has user-to-user email enabled, and has confirmed his/her email address if that is required on this wiki (see Special:MyLanguage/Manual:$wgEmailAuthentication).
$wgContactSender
the email address used as the sender of the contact email, if the visitor does not supply an email address, or if $wgUserEmailUseReplyTo is true. Depending on the setup of your web host, this may have to be an existing mail account. Defaults to $wgEmergencyContact.
$wgContactSenderName
the name to be used with $wgContactSender. This will be shown in the recipient's email program.
$wgContactRequireAll
requires name and email address to be entered on the contact form. This is optional per default. Since rev:37136 (July 2008).
$wgContactIncludeIP
If true, the form will include a checkbox offering to put the IP address of the submitter in the subject line

You can require a CAPTCHA test for the contact page, if you have the ConfirmEdit extension installed. CAPTCHAs are enabled by setting $wgCaptchaTriggers['contactpage'] = true;

Hooks[edit | edit source]

See Extension hook registry for information about hooks added by ContactPage.

See also[edit | edit source]