Send email of a doctype only if Document is Submitted

Hi, Is there any way to create a validation only to send the email only if the document is submitted?

Is there any way to disable or a trigger for this?

Thank you.

Hi @jo_jo,

If you have not checked Notification Documentation then please check it.
https://docs.erpnext.com/docs/v13/user/manual/en/setting-up/notifications

Thank You!

Hi thank you for the reply, The notification is more of a automated way based on trigger to send the notification.

I mean on the doctype the button to send email manually is there any way to hide the button if the document not yet submitted.

Hi @jo_jo,

So you can apply a client/custom script for that.
Please apply and check it.

frappe.ui.form.on('Quotation', {
	refresh(frm) {
	    if(frm.doc.docstatus != 1){
		frm.page.menu.find('[data-label="Menu"],[data-label="Email"]').parent().parent().remove();
	    }
	}
});

Thank You!

WOW thank you It works