signals.py 文件源码

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

项目:django-simplestore 作者: martinstastny 项目源码 文件源码
def send_order_email_confirmation(sender, instance, **kwargs):
    """
    Send email to customer with order details.
    """
    order = instance
    message = get_template("emails/order_conf.html").render(Context({
        'order': order.get_serialized_data()
    }))
    mail = EmailMessage(
        subject="Order confirmation",
        body=message,
        from_email=EMAIL_ADMIN,
        to=[order.email],
        reply_to=[EMAIL_ADMIN],
    )
    mail.content_subtype = "html"
    return mail.send()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号