You can use **Notification
DocType** to send system or email notifications.
or you can use frappe.sendmail()
Actually, I’m using that only. If I book an appointment for one doctor, it shows a system notification for all doctors who are assigned the role of physician. But if I book an appointment for Dr. Raju means I need to
Send a notification for Dr.Raju, not for other doctors who have the role of physician. Please find below attached screenshot.Here i tried add a condition of frappe.session.user.Can you guide me achieve the above scenario ?
No, if any appointment is booked, I need to send a system notification to that particular doctor and not for all doctors. I don’t want to send an email notification
There are some options with that you can achieve this:
-
Use
Custom
and send notification onon_insert()
means status = “Open” -
Create Custom field with fieldtype
Data
and in optionsEmail
and set thatDoctor
’s email_id from user (Your custom logic) and set this custom field in Notification
in reciever by document field set the healthcare practitioner
But it only shows the owner as an option, it doesn’t show another field. Is there any way to add those fields as options?
you can add an email field in the appointment doctype and autofill it when a doctor is selected.
that email field will be visible in the dropdown to select in notifications
This will work for email notification, I need to send system notification only not Email Notification
This will work for email notification, I need to send system notification only not Email Notification for doctors
Hi there how are you the right way to solve this is to add another field in the appoitment doctype email
and fetch if from practitoiner document email
and send the notification based on that email
then it will only send notification to that practitioner and alos you can hide that field if neccesarry it will still work fine
and select the type system notification not email notification
If I choose System notification, I won’t show the email option on the receiver by the user; it shows only owner as option
Mark Email in Reciver mail field then it show it in drop down of notifcation
Can you explain this?
As image attached create data field in Customimizing doctype with filling email using custom code/ or maunal whom you want to send it and with marking Email in option filed
while creating notification select custom email option to whom you want to send it
Here I don’t want to send the email, for I just need to show system notification only
hi there how are you
add a new field in the system by the name by created by or any other name as you require and in options for that field type User it will automatically fetch the field and set the system notification