[zopeorg-checkins] CVS: Products/ZWiki - ZWikiPage.py:1.70

Ken Manheimer klm at zope.com
Tue Dec 18 11:46:22 EST 2001


Update of /cvs-zopeorg/Products/ZWiki
In directory cvs.zope.org:/tmp/cvs-serv24350

Modified Files:
	ZWikiPage.py 
Log Message:
Now that the 'from' address will typically be a standard across a
wiki, i've added the username that made the changes to the
subject line and the body synopsis, and moved around some other info
in the message.


=== Products/ZWiki/ZWikiPage.py 1.69 => 1.70 ===
 
 NOTIFICATION_TEMPLATE = \
-"""From: "Wikis on %(wiki_host)s" <%(from_email)s>
+"""From: "Wikis on %(wiki_host)s for %(who)s" <%(from_email)s>
 Sender: %(sender_email)s
 To: Wiki notification recipients <>
-Subject: Wiki updates - %(qualifier)s: %(id)s
+Subject: Wiki: %(who)s %(qualifier)s %(id)s
 X-Wiki-URL: %(url)s
 List-Unsubscribe: %(subscribe_url)s
 List-Subscribe: %(subscribe_url)s
 
-Wiki page %(qualifier)s (%(num_recips)s recipient%(recips_plural)s):
+Wiki page %(qualifier)s by %(who)s:
   %(url)s
 
 %(delim)s
@@ -134,6 +134,7 @@
 %(delim)s
 To change your page subscription, visit:
   %(subscribe_url)s
+(You are %(recips_phrase)s.)
 """
 
 class ZWikiPage(DTMLDocument, CatalogAware, ZWikiDiffMixin, SubscriberList):
@@ -1423,7 +1424,11 @@
                 return "No update notice sent - no email addrs resolved"
             recipients = string.join(addrs_list, ', ')
             num_recips = len(addrs_list)
-            recips_plural = ((num_recips != 1) and "s") or ""
+            if num_recips == 1:
+                recips_phrase = "the only notification recipient"
+            else:
+                recips_phrase = "among %s notification recipients" % num_recips
+                
 
             wiki_host = REQUEST.BASE0
             if wiki_host[:7] == 'http://':
@@ -1437,19 +1442,22 @@
             userid = str(userobj)
             if (userobj is None) or (userid == str(self.acl_users._nobody)):
                 userid = 'anonymous'
+                who = '??'
+            else:
+                who = userid
 
             try:
                 msg = NOTIFICATION_TEMPLATE % {'wiki_host': wiki_host,
                                                'from_email': from_email,
                                                'sender_email': sender_email,
                                                'qualifier': qualifier,
-                                               'num_recips': len(addrs_list),
-                                               'recips_plural': recips_plural,
+                                               'recips_phrase': recips_phrase,
                                                'id': self.id(),
                                                'url': self.absolute_url(),
                                                'subscribe_url': subscribe_url,
                                                'delim': SECTION_DELIM,
                                                'text': mailouttext,
+                                               'who': who,
                                                }
                 self.MailHost.send(msg, mto=recipients)
                 return None





More information about the zopeorg-checkins mailing list