[pmwiki-users] Email notification on a page change

Hans design at softflow.co.uk
Mon Feb 27 06:40:41 CST 2006


Monday, February 27, 2006, 11:57:59 AM, marco wrote:
> I need to send emails to users on a page modification . I saw the MailPosts
> (http://www.pmwiki.org/wiki/PmWiki/MailPosts) cookbook but I was wondering if
> there was a way to configure it on a per page subscription : different users
> subscribe for notifications different pages and get notified *only* about the
> pages they subscribed to instead of all the pages of the wiki/group.

you could try this (untested):

Create a local customisation php file for each page or group which
needs mailpost notification, like
  local/GroupName.PageName.php

with content:
<?php if (!defined('PmWiki')) exit();

and the mailpost variable definitions according to
http://www.pmwiki.org/wiki/PmWiki/MailPosts :

## Mail post to alert about changes by email
ini_set('SMTP','mail.server.com');
$EnableMailPosts= 1;               # 1 to enable mailposts
$MailPostsTo= "name at example.com";  # where to send mail, use commas to
                                   # separate several email addresses
$MailPostsDelay= 0;                # wait 0 min after initial post
$MailPostsSquelch= 600;            # require 10+ minutes between mails
$MailPostsFrom = 'Wiki server <wiki at example.com>';
$MailPostsMessage = "Recent wiki posts:\n"
  ."  ($ScriptUrl/$FullName)\n\n\$MailPostsList\n";
$MailPostsFile = "$WorkDir/.mailposts{$FullName}";

The last line is for me untested, and may need tweaking.
To give mailpost a unique file for each page or group which requires
mail notification, mailpost will keep lists separate, and only changes
each mailpost list file when changes to the page occur.

In addition I changed the message so it does not show a link to
AllRecentChanges, but to the page instead. (untested again)


Best, 
~Hans                           





More information about the pmwiki-users mailing list