Extension:Mailman

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

Release status: unknown

Implementation Tag
Description Creates a mailman subscribe form
Author(s) User:Mohrr
License No license specified
Download see below

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

Check usage and version matrix; code metrics

Mailman is a very simple extension that creates a mailman subscribe form.

If you're looking for a mass emailer built into the wiki try Extension:STSGMassMailer.

Usage:

<mailman>/relative/url/to/list/recruiting/page</mailman>

For my site, I used the following:

<mailman>/cgi-bin/mailman/subscribe/recruiting</mailman>
  • /cgi-bin/mailman/ is the path to my Mailman installation (through Apache aliases and such)
  • subscribe is the action Mailman is to perform
  • recruiting is the list name

This will probably work with any other mailing list software that you can sign up for online, as long as the email gets passed through HTTP POST to the script in the email field. Or, you can make minor edits as you wish.

Anyway, create this file in your MediaWiki extensions folder:

 # extensions/mailman.php
 
 <?php
 
 $wgExtensionFunctions[] = "wfMailmanExtension"; 
 
 function wfMailmanExtension() {
     global $wgParser;
     $wgParser->setHook( "mailman", "printMailmanForm" );
 }
 
 function printMailmanForm( $input, $argv ) {
 
     global $wgParser;
     $wgParser->disableCache(); 
 
     $output = "<form action=\"$input\" method=\"post\">".
       "<input name=\"email\" type=\"text\" />".
       "<input type=\"submit\" value=\"Subscribe\">".
       "</form>";
     return $output;
 }
 
 ?>

Then add the following to LocalSettings.php:

require_once("extensions/mailman.php");