From f8957cb12182b10513f8c2141e3574053d4578e2 Mon Sep 17 00:00:00 2001
From: Jean-Paul Smets <jp@nexedi.com>
Date: Wed, 21 Apr 2004 19:25:16 +0000
Subject: [PATCH] send to admin as default

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@715 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/CMFActivity/ActivityTool.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/product/CMFActivity/ActivityTool.py b/product/CMFActivity/ActivityTool.py
index 3ed066e61c..d4b3fbe623 100755
--- a/product/CMFActivity/ActivityTool.py
+++ b/product/CMFActivity/ActivityTool.py
@@ -126,9 +126,12 @@ class Message:
     return activity.validate(activity_tool, self, **self.activity_kw)
 
   def notifyUser(self, activity_tool, message="Failed Processing Activity"):
-    user_email = activity_tool.portal_memberdata.getProperty('email')
-    if user_email:
-      mail_text = """From: %s
+    #LOG('notifyUser begin', 0, str(self.user_name))
+    user_email = activity_tool.portal_membership.getMemberById(self.user_name).getProperty('email')
+    if user_email in ('', None):
+      user_email = activity_tool.email_from_address
+    #LOG('notifyUser user_email', 0, str(user_email))
+    mail_text = """From: %s
 To: %s
 Subject: %s
 
@@ -138,7 +141,9 @@ Document: %s
 Method: %s
     """ % (activity_tool.email_from_address, user_email,
            message, message, '/'.join(self.object_path), self.method_id)
-      activity_tool.MailHost.send( mail_text )
+    #LOG('notifyUser mail_text', 0, str(mail_text))
+    activity_tool.MailHost.send( mail_text )
+    #LOG('notifyUser send', 0, '')
 
 class Method:
 
-- 
2.30.9