changeset 2348:8b4c8ebdd8bc

Merge with devel.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Tue, 10 Jul 2007 15:30:34 +0200
parents bf3ec2aadfb6 (current diff) 4d97c3df9677 (diff)
children 7dd064111811
files
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/events/emailnotify.py	Tue Jul 10 01:20:14 2007 +0200
+++ b/MoinMoin/events/emailnotify.py	Tue Jul 10 15:30:34 2007 +0200
@@ -98,13 +98,19 @@
     event_name = event.__class__.__name__
     email = event.user.email or u"NOT SET"
     _ = event.request.getText
+    cfg = event.request.cfg
 
-    title = _("New user account created on %(sitename)s")
+    title = _("New user account created on %(sitename)s") % {'sitename': cfg.sitename or "Wiki"}
     body = _("""Dear Superuser, a new user has just been created. Details follow:
-    User name: %s
-    Email address: %s)""")
+    
+    User name: %(username)s
+    Email address: %(useremail)s)""") % {
+         'username': event.user.name,
+         'useremail': email
+         }
 
-    data = {'from': event.request.cfg.mail_from, 'title': title, 'body': body}
+    from_address = cfg.mail_from
+    data = {'title': title, 'body': body}
     emails = []
 
     for id in user_ids:
@@ -116,7 +122,7 @@
         if usr.isSuperUser() and event_name in usr.subscribed_events:
             emails.append(usr.email)
 
-    send_notification(event.request, emails, data)
+    send_notification(event.request, from_address, emails, data)
 
 def handle(event):
     """An event handler"""
@@ -128,4 +134,3 @@
         return notify_subscribers(event.request, event.page, event.comment, event.trivial)
     elif isinstance(event, UserCreatedEvent):
         return handle_user_created(event)
-