Beispiel #1
0
    def mail(self):
        sender = self._sender
        content = self._content
        issue = self._issue
        comment = self._comment
        target = self._target

        subject = EMAIL_TITLE % (target, issue.title, issue.number)
        hook_url = self.hook_url
        url = self.domain(self._url)

        toaddr = Mail.addrs_by_usernames([sender])
        ccaddr = Mail.addrs_by_usernames(self.noti_receivers, target)

        in_reply_to = IN_REPLY_TO % (target.name, self._issue_id)
        fromaddr = Mail.customize_sender(sender, target.name)
        status_line = "{} commented on issue [{} (#{})]({})".format(
            sender, issue.title, issue.number, url)

        return Mail(
            subject,
            to=toaddr,
            cc=ccaddr,
            from_=fromaddr,
            in_reply_to=in_reply_to,
            context=MailContext('_', data=locals()))
Beispiel #2
0
 def mail_receivers(self):
     ticket = self._ticket
     ticket_id = ticket.ticket_id
     target = self._target
     to_receivers = Mute.filter('ticket', target.name,
                                ticket_id, [ticket.author, ])
     cc_recievers = Mute.filter('ticket', target.name,
                                ticket_id, ticket.participants)
     toaddr = Mail.addrs_by_usernames(to_receivers, target)
     ccaddr = Mail.addrs_by_usernames(cc_recievers, target)
     return toaddr, ccaddr
Beispiel #3
0
 def mail(self):
     sender = self._sender
     content = self._content
     issue = self._issue
     target = self._target
     url = self.domain(issue.url)
     toaddrs = Mail.addrs_by_usernames(self.noti_receivers, target)
     fromaddr = Mail.customize_sender(sender, target.name)
     hook_url = self.hook_url
     in_reply_to = IN_REPLY_TO % (target.name, self._issue_id)
     if issue.is_closed:
         status_line = "Issue closed by %s" % sender
         subject = EMAIL_TITLE % (target.name, issue.title, issue.number)
         message_id = None
     else:
         status_line = "%s create a new issue [%s (#%s)](%s)" % (
             sender, issue.title, issue.number, url)
         subject = "RE:" + EMAIL_TITLE % (target.name, issue.title,
                                          issue.number)
         message_id = in_reply_to
     if toaddrs:
         return Mail(subject,
                     to=toaddrs,
                     from_=fromaddr,
                     in_reply_to=in_reply_to,
                     message_id=message_id,
                     context=MailContext('_', data=locals()))
Beispiel #4
0
 def mail(self):
     sender = self._sender
     content = self._content
     issue = self._issue
     target = self._target
     url = self.domain(issue.url)
     toaddrs = Mail.addrs_by_usernames(self.noti_receivers, target)
     fromaddr = Mail.customize_sender(sender, target.name)
     hook_url = self.hook_url
     in_reply_to = IN_REPLY_TO % (target.name, self._issue_id)
     if issue.is_closed:
         status_line = "Issue closed by %s" % sender
         subject = EMAIL_TITLE % (target.name, issue.title, issue.number)
         message_id = None
     else:
         status_line = "%s create a new issue [%s (#%s)](%s)" % (
             sender, issue.title, issue.number, url)
         subject = "RE:" + EMAIL_TITLE % (target.name, issue.title, issue.number)
         message_id = in_reply_to
     if toaddrs:
         return Mail(subject,
                     to=toaddrs,
                     from_=fromaddr,
                     in_reply_to=in_reply_to,
                     message_id=message_id,
                     context=MailContext('_', data=locals()))
Beispiel #5
0
 def mail_receivers(self):
     toaddr = Mail.addrs_by_usernames([self._proj.owner_id])
     ccaddr = Mail.addrs_by_usernames(self.noti_receivers)
     toaddr.add(EMAIL_REPLY_BOT)
     return toaddr, ccaddr
Beispiel #6
0
 def mail_receivers(self):
     toaddr = Mail.addrs_by_usernames([self._ticket.author])
     #ccaddr = Mail.addrs_by_usernames(self.noti_receivers)
     ccaddr = []
     return toaddr, ccaddr
Beispiel #7
0
 def extra_receivers(self):
     if self._extra_receivers:
         return Mail.addrs_by_usernames(self._extra_receivers)
     else:
         return set()
Beispiel #8
0
 def mail_receivers(self):
     toaddr = Mail.addrs_by_usernames([self._proj.owner_id])
     ccaddr = Mail.addrs_by_usernames(self.noti_receivers)
     toaddr.add(EMAIL_REPLY_BOT)
     return toaddr, ccaddr
Beispiel #9
0
 def mail_receivers(self):
     toaddrs = Mail.addrs_by_usernames(self._team.user_ids)
     ccaddrs = ["*****@*****.**"]
     return toaddrs, ccaddrs
Beispiel #10
0
 def mail_receivers(self):
     toaddrs = Mail.addrs_by_usernames(self._team.user_ids)
     ccaddrs = ["*****@*****.**"]
     return toaddrs, ccaddrs
Beispiel #11
0
 def mail_receivers(self):
     toaddr = Mail.addrs_by_usernames([self._ticket.author])
     ccaddr = Mail.addrs_by_usernames(self.noti_receivers)
     toaddr.add(EMAIL_REPLY_BOT)
     return toaddr, ccaddr
Beispiel #12
0
 def mail_receivers(self):
     toaddr = Mail.addrs_by_usernames([self._ticket.author])
     #ccaddr = Mail.addrs_by_usernames(self.noti_receivers)
     ccaddr = []
     return toaddr, ccaddr
Beispiel #13
0
 def extra_receivers(self):
     if self._extra_receivers:
         return Mail.addrs_by_usernames(self._extra_receivers)
     else:
         return set()