Notification Trigger "Custom"

Hi, when creating a new Notification, the event condition can be set to “Custom”. Unfortunately I cannot find any documentation on this feature. Also there seems to be nothing in the frappe or erpnext codebase to support this. Does anybody know how this works?

I need to send notifications based on my own custom logic, which is executed as a scheduled job daily. I know how to send notifications straight from my python code (frappe.sendmail), but I would love to have all notifications set up in the Notifications doctype for easy maintenance.

1 Like

@philippm check this Notification

Hi @Jeel, all the doc says is:

Custom: Send a notification to an Email Account selected.

What does that mean? All notifications are send per email.

Hi @philippm:

I think “custom” option is not implemented …
You can use “method” option instead.

From your code, .py file or server script …

my_task = frappe.get_doc("Task", "TASK-2024-91408")
my_task.run_notification("test_notification_method")

This will trigger your notification.
Hope this helps.

1 Like

As far as I know,
When you choose custom at send alert on:
Condition comes in there.

Main Difference between Send alert on: New/Save :
At this levels Notification send only New documents or Saves,
But at condition whenever condition true it send notification

Let me give an examp:
If you choose custom then give condition something like
doc.status==“Open” and and doc.priority == ‘High’
Whenever this conditions it will send notification

Hi @avc thats a great workaround, thank you!