Edgewall Software

Ticket #6613: trac-notification-cc_on_newticket.patch

File trac-notification-cc_on_newticket.patch, 1.1 KB (added by me@…, 4 years ago)

adds a TracNotification option for CC on new tickets

  • ticket/notification.py

    old new  
    4141        """Always send notifications to the person who causes the ticket  
    4242        property change.""") 
    4343 
     44    cc_on_newticket = Option('notification', 'cc_on_newticket', '', 
     45        """Email address(es) to send notifications about newly created 
     46           tickets to, addresses can only be seen when use_public_cc is 
     47           enabled (Cc:).""") 
    4448 
    4549class TicketNotifyEmail(NotifyEmail): 
    4650    """Notification of ticket changes.""" 
     
    220224            if notify_owner: 
    221225                torecipients.append(row[2]) 
    222226 
     227        # Send tickets to the cc_on_newticket list of mailaddresses if this is a new ticket 
     228        if self.newticket: 
     229            nccrecipients = self.config.get('notification', 'cc_on_newticket') 
     230            if nccrecipients: 
     231                ccrecipients.append(nccrecipients) 
     232 
    223233        # Harvest email addresses from the author field of ticket_change(s) 
    224234        if notify_reporter: 
    225235            cursor.execute("SELECT DISTINCT author,ticket FROM ticket_change "