Mercurial > p > roundup > code
comparison roundup/roundupdb.py @ 188:1536be43d2fa
Roundupdb now appends "mailing list" information to its messages...
...which include the e-mail address and web interface
address. Templates may override this in their db classes to include
specific information (support instructions, etc).
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 02 Aug 2001 06:38:17 +0000 |
| parents | 9c5ddad06430 |
| children | d45384bc6420 |
comparison
equal
deleted
inserted
replaced
| 187:0384459b2486 | 188:1536be43d2fa |
|---|---|
| 1 # $Id: roundupdb.py,v 1.7 2001-07-30 02:38:31 richard Exp $ | 1 # $Id: roundupdb.py,v 1.8 2001-08-02 06:38:17 richard Exp $ |
| 2 | 2 |
| 3 import re, os, smtplib, socket | 3 import re, os, smtplib, socket |
| 4 | 4 |
| 5 import hyperdb, date | 5 import hyperdb, date |
| 6 | 6 |
| 241 m = ['Subject: [%s%s] %s'%(cn, nodeid, title)] | 241 m = ['Subject: [%s%s] %s'%(cn, nodeid, title)] |
| 242 m.append('To: %s'%', '.join(sendto)) | 242 m.append('To: %s'%', '.join(sendto)) |
| 243 m.append('Reply-To: %s'%self.ISSUE_TRACKER_EMAIL) | 243 m.append('Reply-To: %s'%self.ISSUE_TRACKER_EMAIL) |
| 244 m.append('') | 244 m.append('') |
| 245 m.append(self.db.msg.get(msgid, 'content')) | 245 m.append(self.db.msg.get(msgid, 'content')) |
| 246 m.append(self.email_footer(nodeid, msgid)) | |
| 246 # TODO attachments | 247 # TODO attachments |
| 247 try: | 248 try: |
| 248 smtp = smtplib.SMTP(self.MAILHOST) | 249 smtp = smtplib.SMTP(self.MAILHOST) |
| 249 smtp.sendmail(self.ISSUE_TRACKER_EMAIL, sendto, '\n'.join(m)) | 250 smtp.sendmail(self.ISSUE_TRACKER_EMAIL, sendto, '\n'.join(m)) |
| 250 except socket.error, value: | 251 except socket.error, value: |
| 251 return "Couldn't send confirmation email: mailhost %s"%value | 252 return "Couldn't send confirmation email: mailhost %s"%value |
| 252 except smtplib.SMTPException, value: | 253 except smtplib.SMTPException, value: |
| 253 return "Couldn't send confirmation email: %s"%value | 254 return "Couldn't send confirmation email: %s"%value |
| 254 | 255 |
| 256 def email_footer(self, nodeid, msgid): | |
| 257 ''' Add a footer to the e-mail with some useful information | |
| 258 ''' | |
| 259 web = self.ISSUE_TRACKER_WEB | |
| 260 return '''%s | |
| 261 Roundup issue tracker | |
| 262 %s | |
| 263 %s | |
| 264 '''%('_'*len(web), self.ISSUE_TRACKER_EMAIL, web) | |
| 265 | |
| 255 # | 266 # |
| 256 # $Log: not supported by cvs2svn $ | 267 # $Log: not supported by cvs2svn $ |
| 268 # Revision 1.7 2001/07/30 02:38:31 richard | |
| 269 # get() now has a default arg - for migration only. | |
| 270 # | |
| 257 # Revision 1.6 2001/07/30 00:05:54 richard | 271 # Revision 1.6 2001/07/30 00:05:54 richard |
| 258 # Fixed IssueClass so that superseders links to its classname rather than | 272 # Fixed IssueClass so that superseders links to its classname rather than |
| 259 # hard-coded to "issue". | 273 # hard-coded to "issue". |
| 260 # | 274 # |
| 261 # Revision 1.5 2001/07/29 07:01:39 richard | 275 # Revision 1.5 2001/07/29 07:01:39 richard |
