def send_comment_notification(sender, instance, created, **kwargs):
"""Email relevant users when a new |Comment| is saved."""
# email relevant users if a comment is created
if created and emails_enabled():
for user in instance.get_other_contributors():
email_message = compose_comment_email(instance, user)
try:
email_message.send()
except smtplib.SMTPAuthenticationError as error:
_LOGGER.error('An error occurred when sending an '
'email notification: %s', error)
评论列表
文章目录