def notification_insert(doc, method):
prefs = get_user_notification_preferences(user_email=doc.for_user)
print(doc.name)
if doc.type == “Mention” and doc.for_user and prefs.get(“comments_overall”):
message_data = {
‘subject’: doc.subject,
‘from_user’: doc.email_content
}
frappe.publish_realtime(
event=‘mention_notification’,
message=message_data,
user=doc.for_user,
after_commit=True
)
doc_events = {
“Notification Log”: {
“on_update”: “virtual_munim.api.notification.notification_insert”
}
}
why this docevent not working