I want to add scheduler to send an email every day at particular time

i want to add scheduler to send an email every day at particular time. I have written code which will send email the list of users.
But how can i add scheduler to that code. How can i automate the process, which will send an email to users at particular time?

Cron job from your hooks file should do it choose

Daily
Hourly or
Every 5mins

okay.
Should i put the path of my code in hooks file? I have hooks.py file in which hourly, daily events are created.

Yes link you call to the code in hook file, guess you’ve enable scheduler

yes you can add the following to hooks.py:
this will run the function_name everyday at 13:00 change it how you want

scheduler_events = {
    "cron": {
        "0 13 * * *": [
            "app_name.file_name.function_name"
        ]
    }
}

@spryng okay got it thanks.

@PyJumper thanks.

1 Like

@Aditya_Vig is it suitable for version 14 ?

Are you facing an issue like if the CRON job is new and we do bench migrate then this job is also executed once regardless of given time?