当管理员从管理面板更改值时,如何向用户发送电子邮件

时间:2019-10-01 08:57:30

标签: django python-3.x django-models

我想在用户的帖子需要批准/拒绝时向其发送电子邮件。

class Post(models.Model):
    POST_STATUS = (
        ('approve', 'approve'),
        ('pending', 'pending'),
        ('reject', 'reject')
    )
    user = models.ForeignKey(User,  on_delete=models.CASCADE)
    category = models.ForeignKey(Category,  on_delete=models.CASCADE)

    status =  models.CharField(max_length=10, choices=POST_STATUS, default='pending')

    #title, body, image will be here

0 个答案:

没有答案