Okay
  Public Ticket #2716171
Adding a Cron for appointment reminder
Closed

Comments

  • Hassan Zoorani started the conversation

    Hi, 

    I'm finding it very difficult to follow the step by step for adding a cron line for appointment reminder, can someone please help/assist me to do this?


    Further to this matter, on my wordpress it isn't showing the "add php cron event" despite it being up to date? 

  • [deleted] replied

    Hi Hassan,

    thank you for reaching out to us; I will be happy to provide a more detailed explanation:

    Cron is a Linux utility which schedules a command or script on your server to run automatically at a specified time and date. A cron job is the scheduled task itself. Cron jobs can be very useful to automate repetitive tasks like in our plugin for notifications.

    Depending on the server, there are different configurations for it, which you can contact your hosting provider about, or you can check out one of the solutions for it on this link.

    Also, you can try this:

    */15 * * * * wget -q -O - "https://www.yourwebsite.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send"

    Or this:

    */15 * * * * /usr/local/bin/php ~/public_html/wp-cron.php --action='wpamelia_api' --call='/notifications/scheduled/send'

    Or this:

    GET 'https://yourdomain.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send' > /dev/null

    WP Crontrol plugin is the best option if you're not familiar with cron jobx. You can find more info about it, and detailed instructions on how to set it up in our FAQ section.

    So, if you already read that, and still need some clarification here's some further info.

    You copy only the URL from below a scheduled notification:

    7810032183.png

    Then, in Crontrol go to "Cron Schedules", and scroll all the way down. Add a 15 minute interval:

    7697288025.png

    Then go to "Add PHP Cron Event" and add the URL you've copied like this:

    8523604308.png

    So:

    file_get_contents("yourURL");

    Below it add the name, and set it to run a few minutes in the future, using the provided time format. So, if you're adding the cron event at 12:45, set it to run at 12:50; and then select the schedule you previously selected:

    7642938415.png

    Click on Add Event, and that's it.

    The cron runs every 15 minutes, and checks if there's an email to be sent. So, in Amelia Notifications, your scheduled notifications are set to run every day at a certain time. If you set that time to be 15:00 (for example), the emails will be sent when the cron runs after that time.

    For example, there's an appointment booked for tomorrow, and it's currently 14:44 - the cron runs, but since it's not yet 15:00, it doesn't send anything. It runs again after 15 minutes, so at 14:59, but there are still no emails flagged by Amelia, so it doesn't send anything. Then it runs again at 15:14 and it sees there's an email that should've been sent at 15:00, so it sends the email. It will only send emails when Amelia sees an appointment scheduled for the next day.

    I hope that helps.

  • Hassan Zoorani replied

    Hey Ivana, thank you for your reply! I think the main trouble I'm having is not being able to see the option tab for "add php cron event" - all the other options are showing except that one. This means I'm unable to add a php code on there as you have shown :/

    I'll attach a screenshot :


  • [deleted] replied

    Hi Hassan,

    thank you for letting me know!

    Please check if you are using the latest version of WPCrontrol; in case that you do and the issue persists,it would be needed to reach out to WPCrontrol tech support here, to ask why is the PHP not given as a type option.

    Please let me know what they said.