I am facing some trouble with notifications. Can anyone help?
I plan to implement a notification system in the Sales Order process, where we have a multi-level approval workflow. The billing team creates the sales order and, at the time of creation, assigns a salesperson to handle that order.
In this scenario, I implemented role-based notifications, and while the notification is working, it is being sent to all salespeople. How can I configure it to send notifications only to the assigned salesperson?
Can anyone explain how to set the recipient condition for this?
Brother here only have two option send to document owner or by Role.
In your scenario, you want to sent (Selected Sales person)
this you can achieve by Server Script on Sales Order
for sales_person in doc.sales_team:
sp_email = #here you get the email of sales person
frappe.sendmail(
recipients=sp_email,
subject="Sales Order" + doc.name + "has been Approved",
message="Hi <br> The Document related to <b>Order #</b>" + doc.name + "has been approved<br><br> Thank you",
)