djangoシグナルを扱うのはこれが初めてであり、コメントがフラグ付けされたときに通知するために、コメントアプリによって提供される「comment_was_flagged」シグナルをフックしたいと思います。
これは私のコードですが、機能していないようです。何かが足りませんか?
from django.contrib.comments.signals import comment_was_flagged
from django.core.mail import send_mail
def comment_flagged_notification(sender, **kwargs):
send_mail('testing moderation', 'testing', 'test@localhost', ['myemail@gmail.com',])
comment_was_flagged.connect(comment_flagged_notification)
(私は今のところ電子メールをテストしていますが、電子メールが正しく送信されていることを確認しました。)
ありがとう!