Changeset 42 for emailtotracscript


Ignore:
Timestamp:
01/25/06 18:03:57 (18 years ago)
Author:
bas
Message:

EmailtoTracScript?:

email2trac.py.in, email2trac.conf:

  • Added alternate_notify_template


Location:
emailtotracscript/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • emailtotracscript/trunk/email2trac.conf

    r18 r42  
    1010email_header: 1
    1111trac_version: 0.9
     12alternate_notify_template :
    1213
    1314[bas]
  • emailtotracscript/trunk/email2trac.py.in

    r41 r42  
    135135                else:
    136136                        self.EMAIL_HEADER = 0
     137
     138                if parameters.has_key('alternate_notify_template'):
     139                        self.notify_template = str(parameters['alternate_notify_template'])
     140                else:
     141                        self.notify_template = None
    137142
    138143
     
    280285
    281286                author, email_addr  = email.Utils.parseaddr(msg['from'])
    282                 email_str = self.to_unicode(email_addr)
     287                email_str = self.to_unicode(msg['from'])
    283288                if author:
    284                         tkt['reporter'] = self.to_unicode(author)
    285                 else:
    286                         tkt['reporter'] = self.to_unicode(email_str)
     289                        tkt['reporter'] = email_str
     290                else:
     291                        tkt['reporter'] = email_str
    287292
    288293                if self.CC:
     
    356361
    357362                        tn = TicketNotifyEmail(self.env)
     363                        if self.notify_template:
     364                                tn.template_name = self.notify_template;
     365
    358366                        tn.notify(tkt, newticket=True)
    359367
    360368                except Exception, e:
    361                         print "TD: Failure sending notification on creation of ticket #%s: %s" % (tkt.id, e)
     369                        print 'TD: Failure sending notification on creation of ticket #%s: %s' \
     370                                % (tkt['id'], e)
    362371
    363372        def mail_line(self, str):
Note: See TracChangeset for help on using the changeset viewer.