Index: trunk/extensions/FormatEmail/FormatEmail.php |
— | — | @@ -0,0 +1,53 @@ |
| 2 | +<?php |
| 3 | +if ( ! defined( 'MEDIAWIKI' ) ) |
| 4 | + die(); |
| 5 | + |
| 6 | +/**#@+ |
| 7 | + * Allows custom headers/footers to be added to user to user emails. |
| 8 | + * |
| 9 | + * @package MediaWiki |
| 10 | + * @subpackage Extensions |
| 11 | + * |
| 12 | + * @link http://www.mediawiki.org/wiki/Extension:FormatEmail Documentation |
| 13 | + * |
| 14 | + * |
| 15 | + * @author Travis Derouin <travis@wikihow.com> |
| 16 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 17 | + */ |
| 18 | + |
| 19 | +$wgExtensionFunctions[] = 'wfFormatEmailInit'; |
| 20 | + |
| 21 | +$wgExtensionCredits['other'][] = array( |
| 22 | + 'name' => 'FormatEmail', |
| 23 | + 'author' => 'Travis Derouin', |
| 24 | + 'description' => 'Allows custom headers/footers to be added to user to user emails.', |
| 25 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:FormatEmail', |
| 26 | +); |
| 27 | + |
| 28 | +$wgHooks['EmailUser'][] = 'wfFormatEmail'; |
| 29 | + |
| 30 | +function wfFormatEmailInit() { |
| 31 | + global $wgMessageCache; |
| 32 | + $wgMessageCache->addMessages( |
| 33 | + array( |
| 34 | + 'email_header' => '', |
| 35 | + 'email_footer' => ' |
| 36 | + |
| 37 | +---------------------------------------------------------------------------- |
| 38 | +This email has been sent to you through the {{SITENAME}} email system by $1. |
| 39 | + |
| 40 | +$2', |
| 41 | + ) |
| 42 | + ); |
| 43 | +} |
| 44 | + |
| 45 | +function wfFormatEmail (&$to, &$from, &$subject, &$text ) { |
| 46 | + global $wgUser; |
| 47 | + $ul = $wgUser->getUserPage(); |
| 48 | + $text = wfMsg('email_header') . $text . wfMsg('email_footer',$wgUser->getName(), $ul->getFullURL()); |
| 49 | + return true; |
| 50 | +} |
| 51 | + |
| 52 | + |
| 53 | +?> |
| 54 | + |
Property changes on: trunk/extensions/FormatEmail/FormatEmail.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 55 | + native |
Index: trunk/extensions/FormatEmail/README |
— | — | @@ -0,0 +1,47 @@ |
| 2 | +The '''FormatEmail''' extension allows a customer header or footer to be wrapped |
| 3 | +around user to user e-mails. |
| 4 | + |
| 5 | +== License == |
| 6 | + |
| 7 | +Copyright 2006 Travis Derouin |
| 8 | + |
| 9 | +This program is free software; you can redistribute it and/or modify |
| 10 | +it under the terms of the GNU General Public License as published by |
| 11 | +the Free Software Foundation; either version 2 of the License, or |
| 12 | +(at your option) any later version. |
| 13 | + |
| 14 | +This program is distributed in the hope that it will be useful, |
| 15 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | +GNU General Public License for more details. |
| 18 | + |
| 19 | +You should have received a copy of the GNU General Public License |
| 20 | +along with this program; if not, write to the Free Software |
| 21 | +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | + |
| 23 | +== Author == |
| 24 | + |
| 25 | +Travis Derouin ( travis @ wikihow.com) |
| 26 | + |
| 27 | +== Pre-requisites == |
| 28 | + |
| 29 | +This extension was tested with MediaWiki 1.6.7 and Mediawiki 1.8.2. |
| 30 | + |
| 31 | +== Installation == |
| 32 | + |
| 33 | +Get the source vi SVN. |
| 34 | + |
| 35 | +In your MediaWiki LocalSettings.php, add the following line some place |
| 36 | +towards the bottom of the file: |
| 37 | + |
| 38 | + require_once("$IP/extensions/FormatEmail/FormatEmail.php"); |
| 39 | + |
| 40 | +== Configuration == |
| 41 | + |
| 42 | +Simply change email_header and email_footer in FormatEmail.php. |
| 43 | + |
| 44 | +== Bugs and enhancements == |
| 45 | + |
| 46 | +Bugs or feature requests can be sent to the author at travis @ wikihow.com. |
| 47 | + |
| 48 | + |