@srajelli Fixed in v7. High priority mails like welcome and password reset get sent immediately now.
Thanks I noticed it , But can we do the same for regular emails (Sales Invoice, PO etc) ?
Nope it’s still the same for other documents
I have the same problem and searching for solution
You can write a custom script and add a custom button to forms to send high priority emails. I haven’t done this but I am sure it is possible
If “Send Immediately” was an option in the email form, it would satisfy my needs as well. I’m not sure how one would go about adding this or setting the email priority to bypass the scheduler.
Hi all,
I know this is old, but this seems to be an open topic. I did a bit of digging and found that in ./config/supervisor.conf there is a definition of the workers, containing
[program:frappe-bench-frappe-short-worker]
command=/usr/local/bin/bench worker --queue short
priority=4
autostart=true
autorestart=true
stdout_logfile=/home/frappe/frappe-bench/logs/worker.log
stderr_logfile=/home/frappe/frappe-bench/logs/worker.error.log
user=frappe
stopwaitsecs=360
directory=/home/frappe/frappe-bench
killasgroup=true
numprocs=1
process_name=%(program_name)s-%(process_num)d
As far as I understand, the short worker is used to send mails. stopwaitsecs
is the duration, how long this will be kept alive, so unfortunately, this does not impact the send interval…
Then, I found that in hooks.py
, the email queue is flushed with the all trigger (~every 4 minutes according to https://frappe.io/docs/user/en/tutorial/task-runner). So, I have added to my custom app in the hooks.py
the following block:
scheduler_events = {
"cron": {
"* * * * *": [
"frappe.email.queue.flush"
]
}
}
This seems to run the queue every minute…
Hi, I am also looking for the same solution to reduce the mailing interval. Can you please confirm the same method is applicable in v11.1.18?
I am from a non-tech background. How can I achieve the same?
Kindly help.
Ashin
Yes it will work for v11.x
Thanks.
Hi,
Actually, this doesn’t work for me. I am using V13. I have added the required lines on my custom app hooks.py
Is there anything else I need to do?
This should also work in V13… Alternatively, instead of using the hooks, you could directly put this into your crontab
* * * * * cd /home/frappe/frappe-bench && bench execute frappe.email.queue.flush
This works perfectly. Thanks for your reply.
Can you please explain how to do this? Thanks.
To add this to you (ideally root) crontab, do (this applies for Debain/ubuntu)
$ sudo crontab -e
then enter the above line at the end of the file and hit CTRL-X, Y, ENTER (in case of nano as your editor of choice).
Thanks. I edited the crontab entry to the below since I don’t have a /home/frappe
directory:
* * * * * cd /home/erpnext/frappe-bench && bench execute frappe.email.queue.flush
Still the emails seem to go out every 3 minutes in my case instead of immediately. Anything else that I can do to meake the emails go out immediately?
Thanks
It does not works for me.