python - Django Oscar - 已下订单的电子邮件管理员

标签 python django django-oscar

我试图让 django-oscar 在每次下订单时给我发一封电子邮件。这听起来很简单,但我很挣扎。

我尝试了几种方法,但都失败了......

有没有简单的方法?

最佳答案

您可以为 order_placed 设置监听器发出信号,然后在那里执行您想要的任何操作。

from django.dispatch import receiver

from oscar.apps.order.signals import order_placed

@receiver(order_placed)
def send_merchant_notification(sender, order, user, **kwargs):
    # Do stuff here

或者,派生 orders 应用程序并覆盖 OrderCreator 类以在下订单时注入(inject)额外的逻辑。

关于python - Django Oscar - 已下订单的电子邮件管理员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55290850/

相关文章:

python - ckeditor_uploader 动态图片上传路径

python - Gitlab runner Docker 执行器不连接到 postgres 服务

django-oscar - 将客户定义的可选附加项添加到 django-oscar 站点的购物车中的产品中

python - 冲突 'order' 模型在应用程序 'order'

python - 以编程方式在 Django Oscar 中创建规范的 "parent"产品

python - 用python抓取网页的所有颜色

python - uint8 小端数组到 uint16 大端

python - Pandas :根据列表中的重复值删除行

ajax - Django 。使用 Ajax 显示数据

Python:从开发服务器迁移到生产服务器