sendable_email.py 文件源码

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

项目:django-email-pal 作者: 18F 项目源码 文件源码
def render_body_as_html(self, ctx: T) -> SafeString:
        html_ctx = self._cast_to_dict(ctx).copy()
        html_ctx['is_html_email'] = True
        html_ctx['is_plaintext_email'] = False
        body = render_to_string(self.template_name, html_ctx)

        # TODO: This is a workaround for
        # https://github.com/18F/calc/issues/1409, need to figure
        # out the exact reason behind it.
        body = body.encode('ascii', 'xmlcharrefreplace').decode('ascii')

        return SafeString(body)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号