send.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:byro 作者: byro 项目源码 文件源码
def mail(email: str, subject: str, template: Union[str, LazyI18nString],
         context: Dict[str, Any]=None, locale: str=None,
         headers: dict=None):
    headers = headers or {}

    with override(locale):
        body = str(template)
        if context:
            body = body.format_map(TolerantDict(context))

        sender = Configuration.get_solo().mail_from
        subject = str(subject)
        body_plain = body
        return mail_send_task.apply_async(args=([email], subject, body_plain, sender, headers))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号