Okay
  Public Ticket #3685404
Email Reminders - Cron
Closed

Comments

  • Matthew Williams started the conversation

    Hi there,

    I'm trying to set up email reminders and have followed these instructions - https://tmsplugins.ticksy.com/ticket/3409943/#:~:text=Click%20on%20Add%20Event%2C%20and,cron%20runs%20after%20that%20time. The issue is, where it says to add a new event, the instructions are outdated. There's no "Event Type" or "PHP Code" fields anymore, instead when I follow the instructions, the WP Crontrol plugin now shows "Hook name", "Arguments (Optional)", "Next Run" and "Reccurence" fields.

    Could you please advise me on how I can get Amelia's Reminder emails sent out please with the above in mind.

    Thanks,
    Matt

  •  700
    Stefan replied

    Hi Matthew,

    Thanks for reaching out to us. This configuration still works, but it happens that sometimes users doesn't see the "PHP code" field. 

    Please take a look at this official WP Crontrol Page, in the FAQ section, find this question "which users can manage PHP cron events".

    They mention a possible reason why users can't see the "PHP Event" radio button (the user you're logged in to WordPress with most likely doesn't have the edit_files capability).

    Crons are scheduled tasks of the server, and this is a 3rd party plugin, so it is not an issue coming from Amelia.

    Please make sure you have the latest WP Crontrol version installed and go through the steps explained in their FAQ section, which is mentioned above.

    Also, there's a possibility that a security plugin disallows file editing, which as a result hid that "PHP cron event" option selection in WP Crontrol. In iThemes Security there's a "Disable File Editor" option in settings, and that needs to be turned off as well. If you're using a different security plugin, look for a similar option, or reach out to that plugin's support team.

    SiteGround Optimizer -> Frontend Optimization -> Javascript -> Defer Render-blocking JavaScript (uncheck)

    Just to add, I've just updated the WPCrontol to the latest version and I can still see the options as usual


    5217842470.png

    Please, try and let me know if it works. 

    Kind Regards, 

    Stefan Petrov
    [email protected]

    Rate my support

    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

  • Matthew Williams replied

    Hi,

    I followed your advice and got things working but now see this error on the cron job attached

    Thanks,
    Matt


    Attached files:  Screenshot 2024-07-21 at 16.25.51.png

  •  700
    Stefan replied

    Hi Matthew,

    As you can see, the line is not correct. Please, double-check the cron line. It depends on the server configuration, but it needs to be configured usually like this 

    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, 

    Stefan Petrov
    [email protected]

    Rate my support

    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