Details

Applies to

MoinMoin 1.9

Purpose

Ensure every notification mail starts with [WikiName] Notification ...

Description

In current MoinMoin, if a page changes, you receive a mail starting with [Wiki] ... whereas if an attachement is deleted/added or an user is created the mail subject is of the form Action performed on WikiName. The patch modifies the other functions than prep_page_changed_email to have the same subject line format.

Patch

   1 # HG changeset patch
   2 # User Administrator <>
   3 # Date 1265560079 -3600
   4 # Node ID 3391d823d6f84fcd3e004a2c43f5cc539abdcd3c
   5 # Parent  660b7d2d77edf0f39faaca48a39e3007dbfe4f0c
   6 Make email subjects consistent for every kind of notification
   7 
   8 diff -r 660b7d2d77ed -r 3391d823d6f8 MoinMoin/events/notification.py
   9 --- a/MoinMoin/events/notification.py	Sun Feb 07 17:43:14 2010 +0300
  10 +++ b/MoinMoin/events/notification.py	Sun Feb 07 17:27:59 2010 +0100
  11 @@ -7,6 +7,8 @@
  12  
  13      @copyright: 2007 by Karol Nowak <grywacz@gmail.com>
  14      @license: GNU GPL, see COPYING for details.
  15 +
  16 +    DJ: Mail subjects were not consistent with prep_page_changed_mail in emailnotify.py
  17  """
  18  
  19  from MoinMoin import user, wikiutil
  20 @@ -132,7 +134,7 @@
  21  
  22      @return: a dict containing message body and subject
  23      """
  24 -    subject = _("New user account created on %(sitename)s") % {'sitename': sitename or "Wiki"}
  25 +    subject = _("[%(sitename)s] New user account created") % {'sitename': sitename or "Wiki"}
  26      text = _("""Dear Superuser, a new user has just been created on %(sitename)s". Details follow:
  27  
  28      User name: %(username)s
  29 @@ -154,7 +156,7 @@
  30      """
  31      data = {}
  32  
  33 -    data['subject'] = _("New attachment added to page %(pagename)s on %(sitename)s") % {
  34 +    data['subject'] = _("[%(sitename)s] New attachment added to page %(pagename)s") % {
  35                  'pagename': page_name,
  36                  'sitename': request.cfg.sitename or request.url_root,
  37                  }
  38 @@ -188,7 +190,7 @@
  39      """
  40      data = {}
  41  
  42 -    data['subject'] = _("Removed attachment from page %(pagename)s on %(sitename)s") % {
  43 +    data['subject'] = _("[%(sitename)s] Removed attachment from page %(pagename)s") % {
  44                  'pagename': page_name,
  45                  'sitename': request.cfg.sitename or request.url_root,
  46                  }
changeme.patch

Discussion

Check whether this also applies to 1.8.x and if yes, apply patch there after 1.9.2 release.

Plan


CategoryMoinMoinPatch CategoryMoinMoinBugFixed

MoinMoin: MoinMoinPatch/SameEmailSubjectFormatForEveryNotification (last edited 2010-03-02 18:18:51 by EugeneSyromyatnikov)