Changeset 52728
- Timestamp:
- 04/09/08 17:45:04 (2 years ago)
- Files:
-
- CPS3/products/CPSSubscriptions/trunk/CHANGES (modified) (1 diff)
- CPS3/products/CPSSubscriptions/trunk/Notifications.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
CPS3/products/CPSSubscriptions/trunk/CHANGES
r52616 r52728 7 7 Bug fixes 8 8 ~~~~~~~~~ 9 - 9 - #1903: Notifications are received twice and/or received by the sender email 10 address. 10 11 New internal features 11 12 ~~~~~~~~~~~~~~~~~~~~~ CPS3/products/CPSSubscriptions/trunk/Notifications.py
r49552 r52728 1 1 # -*- coding: ISO-8859-15 -*- 2 # Copyright (c) 2004-200 5 Nuxeo SARL<http://nuxeo.com>2 # Copyright (c) 2004-2008 Nuxeo SAS <http://nuxeo.com> 3 3 # Copyright (c) 2004 CGEY <http://cgey.com> 4 4 # Copyright (c) 2004 Ministere de L'interieur (MISILL) … … 6 6 # Authors : Julien Anguenot <ja@nuxeo.com> 7 7 # Florent Guillaume <fg@nuxeo.com> 8 8 # 9 9 # This program is free software; you can redistribute it and/or 10 10 # modify it under the terms of the GNU General Public License 11 11 # as published by the Free Software Foundation; either version 2 12 12 # of the License, or (at your option) any later version. 13 13 # 14 14 # This program is distributed in the hope that it will be useful, 15 15 # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 17 # GNU General Public License for more details. 18 18 # 19 19 # You should have received a copy of the GNU General Public License 20 20 # along with this program; if not, write to the Free Software 21 21 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 # 22 23 # $Id$ 23 24 24 25 __author__ = "Julien Anguenot <mailto:ja@nuxeo.com>" 25 26 26 """ Notification rule classes27 """Notification rule classes 27 28 28 29 The something that is actually done. Usually it involves Recipients (sending … … 132 133 # Subject 133 134 subject = infos['subject'] 134 subject = string.replace(subject, "\n", "")135 subject = string.replace(subject, '\n', '') 135 136 136 137 # Header … … 138 139 139 140 # To 140 writer.addheader(string.capitalize('to'), 141 mimify.mime_encode_header(infos['to'])) 141 if infos.get('to'): 142 writer.addheader(string.capitalize('to'), 143 mimify.mime_encode_header(infos['to'])) 142 144 # Bcc 143 145 if infos.get('bcc'): … … 171 173 """Validate the mail_infos structure 172 174 """ 173 174 175 return (isinstance(mail_infos.get('sender_email'), str) and 175 isinstance(mail_infos.get('to'), str) and 176 # It is possible that no 'to' nor 'bcc' fields are specified 177 isinstance(mail_infos.get('to', ''), str) and 178 isinstance(mail_infos.get('bcc', ''), str) and 176 179 isinstance(mail_infos.get('subject'), str) and 177 180 isinstance(mail_infos.get('body'), tuple) and … … 183 186 mail_infos contains all the needed information 184 187 """ 185 186 # Check the mail strucuture 187 # It could be build by the user with whatever stuffs within. 188 # Check the mail structure 188 189 if not self._validateStructure(mail_infos): 189 logger.error("sendMail() check the email of the recipients %r",190 logger.error("sendMail() check the email of the recipients %r", 190 191 mail_infos) 191 192 return -1 … … 379 380 def notifyRecipients(self, event_type, object_, infos=None, emails=[], 380 381 members=[], groups=[], **kw): 381 """ Notify recipients382 """Notify recipients 382 383 383 384 This method will be called by the Subscription object when a … … 447 448 'sender_email': semail, 448 449 'subject': self._getSubject(infos), 449 'to': semail, 450 # No 'to' field here, the many recipients 451 # are specified in the 'bcc' field. 450 452 'bcc': bcc, 451 453 'body': (body, mime_type),
