Пример #1
0
    def send(self, torcpts, ccrcpts):
        header = {}

        # Add item specific e-mail header fields.
        if self.message:
            # Get this messge ID.
            header['Message-ID'] = self.get_message_id(self.forum['id'],
                                                       self.topic['id'],
                                                       self.message['id'])
            header['X-Trac-Message-ID'] = to_unicode(self.message['id'])
            header['X-Trac-Discussion-URL'] = self.message['link']

            # Get replied message ID.
            reply_id = self.get_message_id(self.forum['id'], self.topic['id'],
                                           self.message['replyto'])
            header['In-Reply-To'] = reply_id
            header['References'] = reply_id
        else:
            # Get this message ID.
            header['Message-ID'] = self.get_message_id(self.forum['id'],
                                                       self.topic['id'], 0)
            header['X-Trac-Topic-ID'] = to_unicode(self.topic['id'])
            header['X-Trac-Discussion-URL'] = self.topic['link']

        # Send e-mail.
        NotifyEmail.send(self, torcpts, ccrcpts, header)
Пример #2
0
 def send(self, torcpts, ccrcpts):
     mime_headers = {
         'X-Trac-Build-ID': self.queueid,
         'X-Trac-Build-URL': self.build_link(),
         'To': NotifyEmail.get_smtp_address(self, ''.join(torcpts)),
     }
     NotifyEmail.send(self, torcpts, ccrcpts, mime_headers)
Пример #3
0
    def send(self, torcpts, ccrcpts):
        header = {}

        # Add item specific e-mail header fields.
        if self.message:
            # Get this messge ID.
            header['Message-ID'] = self.get_message_id(self.forum['id'],
              self.topic['id'], self.message['id'])
            header['X-Trac-Message-ID'] = to_unicode(self.message['id'])
            header['X-Trac-Discussion-URL'] = self.message['link']

            # Get replied message ID.
            reply_id = self.get_message_id(self.forum['id'], self.topic['id'],
              self.message['replyto'])
            header['In-Reply-To'] = reply_id
            header['References'] = reply_id
        else:
            # Get this message ID.
            header['Message-ID'] = self.get_message_id(self.forum['id'],
              self.topic['id'], 0)
            header['X-Trac-Topic-ID'] = to_unicode(self.topic['id'])
            header['X-Trac-Discussion-URL'] = self.topic['link']

        # Send e-mail.
        NotifyEmail.send(self, torcpts, ccrcpts, header)
Пример #4
0
    def send(self, to_recipients, cc_recipients):
        header = {}

        # Add item specific e-mail header fields.
        if self.message:
            # ID of the message.
            header["Message-ID"] = self.get_message_email_id(self.message["id"])
            header["X-Trac-Message-ID"] = to_unicode(self.message["id"])
            header["X-Trac-Discussion-URL"] = self.message["link"]

            # ID of replied message.
            if self.message["replyto"] != -1:
                reply_id = self.get_message_email_id(self.message["replyto"])
            else:
                reply_id = self.get_topic_email_id(self.message["topic"])
            header["In-Reply-To"] = reply_id
            header["References"] = reply_id
        elif self.topic:
            # ID of the message.
            header["Message-ID"] = self.get_topic_email_id(self.topic["id"])
            header["X-Trac-Topic-ID"] = to_unicode(self.topic["id"])
            header["X-Trac-Discussion-URL"] = self.topic["link"]
        elif self.forum:
            # ID of the message.
            header["Message-ID"] = self.get_forum_email_id(self.forum["id"])
            header["X-Trac-Forum-ID"] = to_unicode(self.forum["id"])
            header["X-Trac-Discussion-URL"] = self.forum["link"]
        else:
            # Should not happen.
            raise TracError("DiscussionPlugin internal error.")

        # Send e-mail.
        self.template = Chrome(self.env).load_template(self.template_name, method="text")
        self.env.log.debug("to_recipients: %s cc_recipients: %s" % (to_recipients, cc_recipients))
        NotifyEmail.send(self, to_recipients, cc_recipients, header)
Пример #5
0
 def send(self, torcpts, ccrcpts):
     dest = self.reporter or 'anonymous'
     hdrs = {}
     hdrs['Message-ID'] = self.get_message_id(dest, self.modtime)
     hdrs['X-Trac-Ticket-ID'] = str(self.ticket.id)
     hdrs['X-Trac-Ticket-URL'] = self.ticket['link']
     if not self.newticket:
         msgid = self.get_message_id(dest)
         hdrs['In-Reply-To'] = msgid
         hdrs['References'] = msgid
     NotifyEmail.send(self, torcpts, ccrcpts, hdrs)
Пример #6
0
 def send(self, torcpts, ccrcpts):
     dest = self.reporter or "anonymous"
     hdrs = {}
     hdrs["Message-ID"] = self.get_message_id(dest, self.modtime)
     hdrs["X-Trac-Ticket-ID"] = str(self.ticket.id)
     hdrs["X-Trac-Ticket-URL"] = self.data["ticket"]["link"]
     if not self.newticket:
         msgid = self.get_message_id(dest)
         hdrs["In-Reply-To"] = msgid
         hdrs["References"] = msgid
     NotifyEmail.send(self, torcpts, ccrcpts, hdrs)
Пример #7
0
 def send(self, torcpts, ccrcpts):
     dest = self.reporter or 'anonymous'
     hdrs = {}
     hdrs['Message-ID'] = self.get_message_id(dest, self.modtime)
     hdrs['X-Trac-Ticket-ID'] = str(self.ticket.id)
     hdrs['X-Trac-Ticket-URL'] = self.data['ticket']['link']
     if not self.newticket:
         msgid = self.get_message_id(dest)
         hdrs['In-Reply-To'] = msgid
         hdrs['References'] = msgid
     NotifyEmail.send(self, torcpts, ccrcpts, hdrs)
Пример #8
0
    def send(self, torcpts, ccrcpts):
        hdrs = {}
        always_cc = self.config['notification'].get('smtp_always_cc')
        always_bcc = self.config['notification'].get('smtp_always_bcc')
        dest = filter(None, torcpts) or filter(None, ccrcpts) or \
               filter(None, [always_cc]) or filter(None, [always_bcc])
        if not dest:
            self.env.log.info('no recipient for a ticket notification')
            return
        hdrs['Message-ID'] = self.get_message_id(dest[0], self.modtime)
        hdrs['X-Trac-Ticket-ID'] = str(self.ticket.id)
        hdrs['X-Trac-Ticket-URL'] = self.data['ticket']['link']

        # determine these headers from the user session
        hdrs['From'] = (self.smtp_from_name, self.smtp_from_email)
        hdrs['Sender'] = self.smtp_from_email
        hdrs['Reply-To'] = '*****@*****.**'

        if not self.newticket:
            hdrs['In-Reply-To'] = self.get_message_id(dest[0])
            hdrs['References'] = self.get_message_id(dest[0])
        NotifyEmail.send(self, torcpts, ccrcpts, hdrs)
Пример #9
0
    def send(self, to_recipients, cc_recipients):
        header = {}

        # Add item specific e-mail header fields.
        if self.message:
            # ID of the message.
            header['Message-ID'] = self.get_message_email_id(self.message['id'])
            header['X-Trac-Message-ID'] = to_unicode(self.message['id'])
            header['X-Trac-Discussion-URL'] = self.message['link']

            # ID of replied message.
            if self.message['replyto'] != -1:
                reply_id = self.get_message_email_id(self.message['replyto'])
            else:
                reply_id = self.get_topic_email_id(self.message['topic'])
            header['In-Reply-To'] = reply_id
            header['References'] = reply_id
        elif self.topic:
            # ID of the message.
            header['Message-ID'] = self.get_topic_email_id(self.topic['id'])
            header['X-Trac-Topic-ID'] = to_unicode(self.topic['id'])
            header['X-Trac-Discussion-URL'] = self.topic['link']
        elif self.forum:
            # ID of the message.
            header['Message-ID'] = self.get_forum_email_id(self.forum['id'])
            header['X-Trac-Forum-ID'] = to_unicode(self.forum['id'])
            header['X-Trac-Discussion-URL'] = self.forum['link']
        else:
            # Should not happen.
            raise TracError('DiscussionPlugin internal error.')

        # Send e-mail.
        self.template = Chrome(self.env).load_template(self.template_name,
          method = 'text')
        self.env.log.debug('to_recipients: %s cc_recipients: %s' % (
          to_recipients, cc_recipients))
        NotifyEmail.send(self, to_recipients, cc_recipients, header)
Пример #10
0
    def send(self, to_recipients, cc_recipients):
        header = {}

        # Add item specific e-mail header fields.
        if self.message:
            # ID of the message.
            header['Message-ID'] = self.get_message_email_id(self.message['id'])
            header['X-Trac-Message-ID'] = to_unicode(self.message['id'])
            header['X-Trac-Discussion-URL'] = self.message['link']

            # ID of replied message.
            if self.message['replyto'] != -1:
                reply_id = self.get_message_email_id(self.message['replyto'])
            else:
                reply_id = self.get_topic_email_id(self.message['topic'])
            header['In-Reply-To'] = reply_id
            header['References'] = reply_id
        elif self.topic:
            # ID of the message.
            header['Message-ID'] = self.get_topic_email_id(self.topic['id'])
            header['X-Trac-Topic-ID'] = to_unicode(self.topic['id'])
            header['X-Trac-Discussion-URL'] = self.topic['link']
        elif self.forum:
            # ID of the message.
            header['Message-ID'] = self.get_forum_email_id(self.forum['id'])
            header['X-Trac-Forum-ID'] = to_unicode(self.forum['id'])
            header['X-Trac-Discussion-URL'] = self.forum['link']
        else:
            # Should not happen.
            raise TracError('DiscussionPlugin internal error.')

        # Send e-mail.
        self.template = Chrome(self.env).load_template(self.template_name,
          method = 'text')
        self.env.log.debug('to_recipients: %s cc_recipients: %s' % (
          to_recipients, cc_recipients))
        NotifyEmail.send(self, to_recipients, cc_recipients, header)
Пример #11
0
 def send(self, torcpts, ccrcpts):
     mime_headers = {
         'X-Trac-Build-ID': str(self.build.id),
         'X-Trac-Build-URL': self.build_link(),
     }
     NotifyEmail.send(self, torcpts, ccrcpts, mime_headers)
Пример #12
0
 def send(self, torcpts, ccrcpts):
     mime_headers = {
         'X-Trac-Build-ID': str(self.build.id),
         'X-Trac-Build-URL': self.build_link(),
     }
     NotifyEmail.send(self, torcpts, ccrcpts, mime_headers)
Пример #13
0
 def send(self, torcpts, ccrcpts):
     if self.imitate_ticket_notification:
         TicketNotifyEmail.send(self, torcpts, ccrcpts)
     else:
         NotifyEmail.send(self, torcpts, ccrcpts)
Пример #14
0
 def send(self, torcpts, ccrcpts):
     return NotifyEmail.send(self, torcpts, ccrcpts)
Пример #15
0
 def send(self, torcpts, ccrcpts):
     if self.imitate_ticket_notification:
         TicketNotifyEmail.send(self, torcpts, ccrcpts)
     else:
         NotifyEmail.send(self, torcpts, ccrcpts)
Пример #16
0
 def send(self, torcpts, ccrcpts):
     return NotifyEmail.send(self, torcpts, ccrcpts)
Пример #17
0
 def send(self, torcpts, ccrcpts):
     """
     Override NotifyEmail.send() so we can provide from_name.
     """
     self.from_name = self.comment_author
     NotifyEmail.send(self, torcpts, ccrcpts)