Try ERPNext Buy Support Partners Foundation Foundation Members

Email notification taking more time how to fix this?

Hi Team,
Having some issue regarding the email notification .when i create sales order and submit it after 3,4 min the email notification receive ,same in sales invoice ,etc.
how to reduce this time ?
please help me sort out this …

Thanks

I’m not sure for this kind of notification but e-mails are sent in batch each 5 minutes.
It’s also possible to send email directly with another function

1 Like

can we reduce this time ??
It possible or not?

For the batch it’s written in the source code, I don’t think it’s accessible with a variable

1 Like

i make this immediately after i click on the condition like save ,submit etc as per the Send Alert On that doctype

Signature for sendmail is here : https://github.com/frappe/frappe/blob/ea3b9cea60a1024d0148082af7d6d44c8fa944d3/frappe/init.py#L418

If you call frappe.sendmail with the delayed parameter to false it will be sent immediatly

By default all notifications are enqueued.

Queue are configured in background jobs here : https://github.com/frappe/frappe/blob/ea3b9cea60a1024d0148082af7d6d44c8fa944d3/frappe/utils/background_jobs.py#L15

There is a default timeout of 300 seconds.

So if you want to change this behavior you will need to create custom script.