Ticket #1383: improved_notifications_6233.diff
File improved_notifications_6233.diff, 2.4 KB (added by , 16 years ago) |
---|
-
trac/ticket/notification.py
75 75 change_data = {} 76 76 link = self.env.abs_href.ticket(ticket.id) 77 77 summary = self.ticket['summary'] 78 author = '' 78 79 79 80 if not self.newticket and modtime: # Ticket change 80 81 from trac.ticket.web_ui import TicketModule … … 88 89 CRLF) 89 90 }) 90 91 link += '#comment:%s' % str(change.get('cnum', '')) 92 author = change['author'] 91 93 for field, values in change['fields'].iteritems(): 92 94 old = values['old'] 93 95 new = values['new'] … … 127 129 changes_body += ' * %s: %s%s' % (field, chg, CRLF) 128 130 if newv: 129 131 change_data[field] = {'oldvalue': old, 'newvalue': new} 132 133 if self.newticket: 134 author = ticket["reporter"] 130 135 131 136 self.ticket['description'] = wrap( 132 137 self.ticket.values.get('description', ''), self.COLS, … … 146 151 'changes_descr': changes_descr, 147 152 'change': change_data 148 153 }) 149 NotifyEmail.notify(self, ticket.id, subject )154 NotifyEmail.notify(self, ticket.id, subject, author) 150 155 151 156 def format_props(self): 152 157 tkt = self.ticket -
trac/notification.py
213 213 else: 214 214 raise TracError(_('Invalid email encoding setting: %s' % pref)) 215 215 216 def notify(self, resid, subject ):216 def notify(self, resid, subject, from_name=None): 217 217 self.subject = subject 218 218 219 219 if not self.config.getbool('notification', 'smtp_enabled'): … … 231 231 ' nor ', tag.b('notification.reply_to'), 232 232 'are specified in the configuration.')), 233 233 'SMTP Notification Error') 234 if not self.from_name: 235 self.from_name = from_name 234 236 235 237 # Authentication info (optional) 236 238 self.user_name = self.config['notification'].get('smtp_user')