How can I solve the delay when I send an email?

In which file can I find this function:

frappe.sendmail(
recipients=recipients,
subject=frappe.(‘Birthday Reminder’),
template=‘birthday_reminder’,
args=dict(
reminder_text=reminder_text,
birthday_persons=birthday_persons,
message=message,
),
header=
(‘Birthday Reminder’),
delayed=False
)

I want to add delayed = False if it will help !

Where the file that I can update this function ?

Hi,

The email code is in apps/frappe/frappe/email.

It might be helpful to look at the email queue report and error logs to see if there are any relevant messages to explain the delay.

File path of employee birthday reminder.

my problem when I send email take more times may be not sent

I have to go to email queue and send it now.

I need to send email immediately

You can override this function and add a delayed argument when calling the function.

could you please give me how can I add it ?

If you want to override it, you’ll need a custom app and will have to use monkey-patching to override this function. After overriding, add the delayed argument when calling the birthday reminder function.

The birthday reminder function runs daily via a cron job at 12 AM. It sends bulk emails, so it can take time. Did you need to send a different email immediately, and were you using the birthday email as just a reference for your question?