本文整理汇总了Python中sentry.utils.email.MessageBuilder._send_to方法的典型用法代码示例。如果您正苦于以下问题:Python MessageBuilder._send_to方法的具体用法?Python MessageBuilder._send_to怎么用?Python MessageBuilder._send_to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sentry.utils.email.MessageBuilder
的用法示例。
在下文中一共展示了MessageBuilder._send_to方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _build_message
# 需要导入模块: from sentry.utils.email import MessageBuilder [as 别名]
# 或者: from sentry.utils.email.MessageBuilder import _send_to [as 别名]
def _build_message(self, subject, template=None, html_template=None,
body=None, project=None, group=None, headers=None,
context=None):
"""
Identical function to _build_message for sentry_mail, by the Sentry
Team, except for the send_to list that is received is assigned to
the message's list instead of appended.
"""
send_to = self.get_option('emails', project) or []
if not send_to:
logger.debug('Skipping message rendering, no users to send to.')
return
subject_prefix = self.get_option('subject_prefix', project) or \
self.subject_prefix
subject_prefix = force_text(subject_prefix)
subject = force_text(subject)
msg = MessageBuilder(
subject='%s%s' % (subject_prefix, subject),
template=template,
html_template=html_template,
body=body,
headers=headers,
context=context,
reference=group,
)
msg._send_to = set(send_to)
return msg