Okay
  Public Ticket #3775055
Cron Event
Open

Comments

  •  6
    Gila Dávid started the conversation

    Dear support team,

    My developer set up the cron event years back and it was working as it was supposed for years. Now for months, it stopped working.

    I have reached out to my developer and confirmed that the code is still injected, and he confirmed that 

    */15 * * * * curl -s "https://instawalk.eu/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send
    " >/dev/null 2>&1

    is still the part of the daily routine, yet it doesn't work.

    I can confirm that the other emails such as booking approvals and reschedule etc are working.

    Just the reminder and the follow-up does not send any more.

    What can be the issue in this case?


  •  1,589
    Uroš replied

    Hello Gila,

    Thank you for reaching out to us.

    For this purpose, I would suggest that you set up a cronjob in WP Crontrol.

    WP Crontrol plugin is the best option for configuring cron jobs. 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, go to Tools/Cron Events, and click on the "Cron Schedules" tab. In it, add a 15-minute interval:

    2487877415.png

    Then go back to the "Cron Events" tab and click on "Add new":

    9085918175.png

    Below it, select the "PHP Cron event" radio button, and add the URL you copied from Amelia/Notifications in this form:

    file_get_contents("yourURL");
    2095163400.png

    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 (local, current time), 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.

    Kind Regards, 

    Uros Jovanovic
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  6
    Gila Dávid replied

    Dear Uros,

    As I have clearly stated in my first email, that the issue is not in the code itself, it was working for years, until suddenly stopped, so solving the same code with a plugin results in the same outcome.

    Yet I wanted to make sure I troubleshoot the issue from the plugin side too, I have carefully followed the steps and applied the plugin settings, and I can confirm the Cron doesn't work as it used to even with the plugin.

    Again just to emphasize, the emails are working when they are not triggered from Cron, so something is behind this issue.

    How to figure it out?

  •  1,589
    Uroš replied

    Hello Gila,

    Thank you for the clarification. Since the issue seems related to the Cron job not functioning as it should, and emails are sent when not triggered by Cron, this suggests that the issue might lie with how the Cron job is being executed or the server environment.

    Unfortunately, I can't perform checks for server-side code directly. However, I recommend the following steps to troubleshoot:

    1. Check Cron Job Logs: Review your server’s Cron job logs to see if there are any errors or issues when the Cron job is triggered.

    2. Verify Server Configuration: Ensure that the Cron job is set up correctly in your server’s configuration. Sometimes, the Cron service may be disabled or misconfigured, which could prevent it from executing as expected.

    3. Server Debugging: If you're still unable to resolve the issue, I suggest reaching out to your hosting provider or server admin for further debugging. They can assist with checking server-side logs and configurations.

    Let me know if you need further assistance!

    Kind Regards, 

    Uros Jovanovic
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  6
    Gila Dávid replied

    Hey Uros,

    I have initially asked my administrator to look into it, he said everyhing is fine, thats why I sent you the message.

    After getting to a deadend with you, I have pushed my admin, and it happened to be a certificate rejtection server and because he changed the DNS...

    Thank you for your assist anyways, case closed!

    Have a wonderful 👋 

  •  1,589
    Uroš replied

    Hello Gila,

    Thank you for the update! I'm glad you were able to identify the issue with your administrator and resolve it successfully.

    If you need any further assistance in the future, don't hesitate to reach out. Wishing you all the best! 👋

    Kind Regards, 

    Uros Jovanovic
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables