本文整理汇总了Python中trac.notification.NotifyEmail.send方法的典型用法代码示例。如果您正苦于以下问题:Python NotifyEmail.send方法的具体用法?Python NotifyEmail.send怎么用?Python NotifyEmail.send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trac.notification.NotifyEmail
的用法示例。
在下文中一共展示了NotifyEmail.send方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send
# 需要导入模块: from trac.notification import NotifyEmail [as 别名]
# 或者: from trac.notification.NotifyEmail import send [as 别名]
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: send
# 需要导入模块: from trac.notification import NotifyEmail [as 别名]
# 或者: from trac.notification.NotifyEmail import send [as 别名]
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)
示例3: send
# 需要导入模块: from trac.notification import NotifyEmail [as 别名]
# 或者: from trac.notification.NotifyEmail import send [as 别名]
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)
示例4: send
# 需要导入模块: from trac.notification import NotifyEmail [as 别名]
# 或者: from trac.notification.NotifyEmail import send [as 别名]
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)
示例5: send
# 需要导入模块: from trac.notification import NotifyEmail [as 别名]
# 或者: from trac.notification.NotifyEmail import send [as 别名]
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'] = '[email protected]'
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)
示例6: send
# 需要导入模块: from trac.notification import NotifyEmail [as 别名]
# 或者: from trac.notification.NotifyEmail import send [as 别名]
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)
示例7: send
# 需要导入模块: from trac.notification import NotifyEmail [as 别名]
# 或者: from trac.notification.NotifyEmail import send [as 别名]
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)
示例8: send
# 需要导入模块: from trac.notification import NotifyEmail [as 别名]
# 或者: from trac.notification.NotifyEmail import send [as 别名]
def send(self, torcpts, ccrcpts):
if self.imitate_ticket_notification:
TicketNotifyEmail.send(self, torcpts, ccrcpts)
else:
NotifyEmail.send(self, torcpts, ccrcpts)
示例9: send
# 需要导入模块: from trac.notification import NotifyEmail [as 别名]
# 或者: from trac.notification.NotifyEmail import send [as 别名]
def send(self, torcpts, ccrcpts):
return NotifyEmail.send(self, torcpts, ccrcpts)
示例10: send
# 需要导入模块: from trac.notification import NotifyEmail [as 别名]
# 或者: from trac.notification.NotifyEmail import send [as 别名]
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)