Send PDF automatically when new entries or submitted

Hi all,
The donation doctype captures donation and donor details using RazorPay.Now I, need to send the payment receipt to the donor. I have custom print format for payment receipt now if entry is submitted on donation doctype I need to send email automatically with payment receipt as pdf . how to achieve this ?

When you submit the Donation doctype and want to send its PDF, you can use the Notification doctype. You can set it to send the PDF automatically upon submission. However, if the receipt is part of a different doctype, you will need to use a server script with the on_submit doc_event and call frappe.sendmail.


I tried it with the Notification Doctype but it doesn’t send any email to that paid user and the recipient section has Receiver by document field it shows owner as only where I configure receiver email, can we you help me with this?