Okay
  Public Ticket #3581013
Sms for next day appointments not working
Closed

Comments

  •  4
    Mārtiņš started the conversation

    Hey there!

    Test sms working. Scheduled does not. 

    1. I could swere it was working before without cron, and there are messages in msg history.

    2. Tried from a tutorial that I found in public ticket to configure with WP Control, but I dont have such fields, maybe old tutorial. 

    3. Now I have made Cron in Sitegrounds.com as in your documentation

    Command:

    wget -q -O /dev/null “https://skaistuma-estetika.lv/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send” > /dev/null 2>&1

    Interval: 

    Twice Per Hour

     (0,30 * * * *)


    What could be wrong?




    Attached files:  Ekrānuzņēmums 2024-02-09 122347.png

  •  1,184
    Uroš replied

    Hello Mārtiņš,

    Thank you for reaching out to us.

    WP Crontrol plugin is the best option for creating 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.

    We can confirm that the process is still the same for WP Crontrol,

    It seems that you simply don't see the "PHP Event" radio option while making a new Cron Event in WP Crontrol.

    Here is how it should look, a screenshot from our testing environment when adding a new Cron job:

    6585683207.png

    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)


    Kind Regards, 

    Uros Jovanovic
    [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

  •  4
    Mārtiņš replied

    I already found this answer in forums. There is no radio button called PHP cron event. See attachment.

    Attached files:  11111.png

  •  4
    Mārtiņš replied

    Ok, I already found in Wp Control answer that i dont have rights. 

    Why is not cron for Siteground from your manual not working?

    https://wpamelia.com/notification-settings/

    If you’re using SiteGround, you’ll most likely need to add the cron job like this:

    wget -q -O /dev/null “https://yourdomain.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send” > /dev/null 2>&1

    The main question is why did it work in the begining? 

    SMS History screenshot https://failiem.lv/f/axa4jkw846


    Ok, I got my sms executing manually, but it is not working on siteground and I cannot configure it in WP Control

  •  1,184
    Uroš replied

    Hello Mārtiņš,

    Thank you for the update on this and for your patience.

    Please provide me a temporary WP-admin (administrator) user for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. 

    We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties. 

    You can write credentials here just check PRIVATE Reply so nobody can see them except us.


    Kind Regards, 

    Uros Jovanovic
    [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

  •   Mārtiņš replied privately
  •  1,184
    Uroš replied

    Hello Mārtiņš,

    Thank you for the update on this and for your patience.

    Can you please test it out now and let me know if it works or not?

    Looking forward to your reply.


    Kind Regards, 

    Uros Jovanovic
    [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

  •  4
    Mārtiņš replied

    Thank you so much! Could you please explain what did you do? I have another client working with Amelia. 

  •  1,184
    Uroš replied

    Hello Mārtiņš,

    Thank you for the update on this.

    I retested it and it worked fine, so there were no changes made.

    Please let me know if you have any other questions.


    Kind Regards, 

    Uros Jovanovic
    [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

  •  4
    Mārtiņš replied

    Sorry Uroš, I was celebrating too early, I think it worked automatically for one day, and yesterday again it did not. :( Or maybe you launched it manually with cron lin on 20.02 ? 21.02 did not send it automatically. My previous booking plugin made all crons automatically on install and worked exellent. Even on siteground.com hosting.

  •  1,184
    Uroš replied

    Hello Mārtiņš,

    Can you please update the plugin to the latest version (7.4.1), test it out, and let me know if it works or not?

    Looking forward to your reply.


    Kind Regards, 

    Uros Jovanovic
    [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

  •  4
    Mārtiņš replied

    Still not working.

    But now I am confused- which way should I test?

    1. Siteground cron

    or

    2. WP Control plugin? (it has no php option to select)

  •  2,499
    Aleksandar replied

    Hello Mārtiņš.

    Uroš is currently on vacation so I'll take over this ticket.

    Give me an hour or two to check this ticket in detail and I'll get back to you with the info what the best approach would be.

    Kind Regards, 

    Aleksandar Vuković
    [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

  •  2,499
    Aleksandar replied

    Hi again Mārtiņš.

    Sorry for the delay.

    Siteground's security plugin disallows file editing, which as a result hid the "PHP cron event" option selection in WP Crontrol. I know that SG Optimizer is one of the plugins that does this and the way to resolve it would be:

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

    On your website, I didn't see SG Optimizer, but I did see a few other "Optimizer" plugins, so please search for similar commands in there. For example, in iThemes Security there's a "Disable File Editor" option in settings, and that needs to be turned off as well

    Once you do this, you will see the "PHP event" option in WP Crontrol.

    As for Siteground cron job, there are a few reports from our customers, and I'll share them with you:

    1. Feedback from August 2023 (which made its way into our documentation):

    wget -q -O /dev/null "https://yourwebsite.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send" > /dev/null 2>&1
    

    This customer said that SiteGround's support assisted her with this and they provided this code.

    2. Access the wp-config.php file of your website and locate the line: 

     define('DB_COLLATE', ''); 

    Under it, add the following line: 

     define('DISABLE_WP_CRON', false);

    3. A response from SiteGround's support, copied and pasted into a private ticket:

    You may use the wget command to trigger the cron job, but I personally recommend you the curl command as it can send you any outputs from the cron job to your email:

    curl "https://yourwebsite.ca/wp-admin/admin-ajax.php?action=wpamelia_api&call=/notifications/scheduled/send"

    In this way you will be able to monitor the cron job executions.

    Please try out these methods and let me know how it works. The best way to test it is to book an appointment for tomorrow, and wait to see if there's a reminder email. As you previously mentioned - manually triggering the cron will most likely work, but the automatic execution may cause issues.

    Looking forward to your response!

    Kind Regards, 

    Aleksandar Vuković
    [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