Appointments+ is not sending confirmation emails to user or admin

Appointments+ is not sending confirmation emails to user or admin. WP is able to send emails - just tested. Using latest versions of Appointments+ and WP.

Admin does get notified when an appointment is set.
Admin goes to confirm it and no emails get sent out (log does not show email going out but it does show 'changed from pending to confirmed'.

Thanks

  • Guy

    Hello Nastia,

    Thanks for your help.

    It's not working. Now when the user goes to click on a time (they click date first, then time) you get the wheel spinning. Also in admin, going to See Details & Edit the appointment it gives the spinning wheel and doesn't open up the appointment details.

    I'm going to change it back to the old php file, because at least then the appointments were made, just no emails went out.

    Can you please continue to help with this?

    Thanks,
    Guy

  • Dimitris

    Hello there Guy,

    hope you're doing good today and don't mind me chim in here!

    I've just tested this in a local site of mine and I can confirm that both visitor and admin users got their emails. https://monosnap.com/file/jIyYKMmXDzmbrZduXDvs5C3PElg744

    Now when the user goes to click on a time (they click date first, then time) you get the wheel spinning. Also in admin, going to See Details & Edit the appointment it gives the spinning wheel and doesn't open up the appointment details.

    I was also unable to see such issues in my end, so I presume that this is specific to your website.
    Could you please try a quick conflict test, just to ensure that this is happening strictly due to Appointments+ plugin (or not)? Concept here is to deactivate all other plugins apart from WPMUDEV Dashboard and Appointments+, activate a default theme like TwentySeventeen, clear/purge any caches and try again the booking functionalities, as well as the wp-admin administration and outgoing emails.
    If these are working good, then activate the remaining plugins and theme, one by one this time, checking each time above issues, until you reproduce them once again (thus, finding the conflicted combination that causes these).
    https://premium.wpmudev.org/wp-content/uploads/2015/09/Support-Process-Support-Process.gif

    If you can't perform such test due to the live status of this domain, then you should either create a staging environment first (meaning a complete and exact copy of this website into another location/folder in the same server, using a separate database), where you can safely proceed with above conflict test, or use a handy plugin that lets you deactivate all plugins for admin user only, called Health Check.

    Let us know about your results on this, also please grant support access to your website via WPMUDEV Dashboard plugin, so we could have a better look at your settings.

    Warm regards,
    Dimitris

  • Guy

    Hello Dimitris,

    Access granted.

    When using the class-app-ajax.php from the recommended 'fix', front-end users get spinning wheel and can't book an appointment. WP admin gets spinning wheel not only in appointments+ but other areas as well, including trying to search for the Health Check plugin you recommended. So I had to revert back to the class-app-ajax.php prior to the fix (at least appointments can be made this way, just no confirmations go out).

    Is it possible to roll back to a prior appointments+ version? If not, this would be a good feature.

    Right now, I'm going to install Health Check, update class-app-ajax.php to the 'fix' and then try things out. Then revert back to prior class-app-ajax.php so at least appointments can be booked and I will send manual confirmations. But please provide a fix that works. Access is granted and I hope you can address this asap.

    Thanks,
    Guy

  • Dimitris

    Appreciate the feedback on this Guy

    It seems that this is happening with the attached file here, but as I was trying this via our private repository I wasn't able to reproduce.

    Could you please give a try with this attached file instead and let us know how that goes?

    I just re-tested this with it and booking form is being displayed successfully.

    I remind you that you're putting this file in /wp-content/plugins/appointments/includes/.

    Warm regards,
    Dimitris

  • Guy

    Hello Dimitris,

    Thanks for trying. This new file works like the original from the update in that both front end and back end work (no wheel spinning and appointments can be made, and admin gets notification that there is an appointment to confirm) BUT - user and admin do not get confirmation emails after confirming the appointment in the back end. If admin cancels the appointment in the backend, user and admin get email notifications.

    So - something is wrong with the file/program relating to confirmation emails - back to square one.

    Please help fix this.

    Thanks,
    Guy

  • Guy

    QUESTION:

    I'm trying to help troubleshoot. I gave you access but don't think anyone's been in to check my settings.

    I was given these 'fixes' for functions.php in the past. Are they still needed? Or could they be interfering with the operation of the updated version? Please see below.

    Thanks,
    Guy

    -------------------------------------------------------------------

    <?php

    function modify_duration_text( $text, $duration ) {
    return ($duration -30) . ' minutes';
    }
    add_filter('app_confirmation_lasts', 'modify_duration_text', 10, 2);

    function app_redirect( ){

    ?>
    <script type="text/javascript">
    window.app_location = function () { return "http://-----/free-session/thanks-for-your-reservation/"; }
    </script>
    <?php

    }
    add_action( 'wp_footer', 'app_redirect' );

    function rebind_footer_redirections ($script) {
    return $script . '$(".appointments-confirmation-cancel-button").off("click").on("click", function () {window.location.href=app_location();});';
    }
    add_filter('app_footer_scripts', 'rebind_footer_redirections', 999);

    global $appointments;
    if ( $appointments instanceof Appointments ) {
    add_filter( 'app_confirmation_message', 'append_location_to_app_email', 10, 2 );
    add_filter( 'app_reminder_message', 'append_location_to_app_email', 10, 2 );
    function append_location_to_app_email( $msg, $obj ) {
    if ( property_exists( $obj, 'location' ) ) {
    $locations = get_option( 'app_locations_data' );
    foreach ( $locations as $value ) {
    if ( $obj->location == $value['id'] ) {
    $msg = str_replace( 'LOCATION', $value['address'], $msg );
    return $msg;
    }
    }
    }
    }
    }
    include_once(WP_PLUGIN_DIR . '/appointments/includes/class-app-gcal.php');
    $gcal = new Appointments_Google_Calendar();
    add_filter( 'appointments_gcal_sync', $gcal->maybe_sync );

    add_action( 'admin_head', 'wpmu_5433_hide_google_descr' );

    function wpmu_5433_hide_google_descr(){
    if('Appointments' == get_admin_page_title()) { ?>
    <style>
    .appointments .inline-edit-col-left > .inline-edit-col > .title:last-child {
    display: none;
    }
    </style>
    <?php }
    }

  • Dimitris

    Hello there Guy,

    above snippets shouldn't cause any issues, but I'll need to further advise our SLS team about it.
    In order to have a better look, and probably try out some other hotfixes, I'd like you to provide some more server credentials. As this is public forum, you should send us your details through our safe contact form https://premium.wpmudev.org/contact/#i-have-a-different-question using this template:

    Subject: "Attn: Dimitris"
    - WordPress admin (login url/username/password)
    - FTP credentials (host/username/password)
    - cPanel/Plesk credentials (host/username/password)
    - link back to this thread for reference
    - any other relevant urls

    Keep in mind the subject line as ensures that it gets assigned to me.

    Warm regards,
    Dimitris

  • Dimitris

    Hello there Guy,

    hope you're doing good today!

    I've made some further tests locally after downloading parent and child themes from your server.
    I was able to see that no emails were being sent out and narrowed this down in wp-content/themes/divichild/functions.php file and specifically in lines 24~42
    https://monosnap.com/file/WP8rcqmAJL7IoKoAqviSEuixSROhcN
    (after commenting out these lines, emails were sending out successfully)

    I've already contacted our plugin developers on how this should be properly added, we'll keep you posted here as soon as we've got some valuable insights.

    Warm regards,
    Dimitris

  • Guy

    Hi Dimitris,

    Hope all's well.

    Thanks for staying on top of this.

    I uploaded the new functions.php and was hoping for positive results. Unfortunately, it's the same as before. When I confirm without checking the (Re)send box, no emails go out. If I confirm and check the box, 2 emails go out to each party. Like before.

    Did you send me the correct/updated functions file?

    Thanks,
    Guy

  • Panos

    Hey Guy ,

    I just checked by installing your child theme, with Dimitri's fix, and replacing the file you have attached and it worked. It did send ( and re-send ) confirmation emails from admin. So I then tested on your site and it did send all confirmation emails for the test appointment I tried.

    Could you please check when updating an appointment, that it's status is confirmed (or paid)? . Else, could you let me know if there is something I am missing here?

    Thanks!

  • Guy

    Hi Panos,

    I'm sorry but you might have missed something from the explanation of the problem.

    At this point, when an appointment is requested, admin gets an email to log in to confirm it. Admin does what admin has always done since a previous update, which is to simply change from pending to confirmed (not selecting the checkbox (re)send) and then click Save / Update. Then both user and admin are supposed to get one email each but they don't. That's the problem. Take a look at the log. It will show that an email went out to admin about the appointment but it won't say it sent an email to user or admin (because it didn't).

    If, when confirming the appointment for the first time, I decide to check the box that says (re)send, both user and admin will get 2 emails. None if you don't check the box. 2 each if you check the box. Something like this has already happened in the past with previous updates (and I'm not the only one).

    Interestingly, if you go to confirm the appointment without checking the box, an email won't go out but if you go back to the edit the saved appointment, and check the box to (re)send email, it will send only one. But this is not reasonable to do every time, it's just a constant reminder of a problem with the software.

    Can you make it so it works correctly the first time? Confirm without checking the box and only one email gets sent to the admin and one to the user.

    Thank you,
    Guy

    I can see from your tests that two emails go to the admin (me) -

  • Nastia

    Hello Guy

    Hope all is well!

    Admin does what admin has always done since a previous update, which is to simply change from pending to confirmed (not selecting the checkbox (re)send) and then click Save / Update. Then both user and admin are supposed to get one email each but they don't. That's the problem.

    Out of the box, when (Re)send confirmation email option is checked, the Appointments sends the email to both users, admin and a client. If the option is not checked no emails are sent from the plugin. This is how the plugin was developed in the first place, in case if service providers will require to edit an appointment without (re)sending a confirmation email to a client.

    I've visited your site and after changing the pending appointment status to Confirmed, with the (Re)send confirmation email option ticked, I received both confirmation emails. In the previous version of the plugin, an email was indeed sent to both users when the "(Re)send confirmation email" option was not checked, though this was a bug it was fixed in the current version.

    I will ask for developer's feedback if it is possible to overwrite with a custom code and will reply back in this thread.

    Have a nice day and take care!

    Kind regards,
    Nastia

  • Guy

    So you're saying it was a bug that was fixed. This bug's been around before.

    Here's the issue (and I won't go into history of bug fixes that eventually got us here) - when I check the box, 2 emails get sent to each party instead of 1. Nobody wants to get 2 identical emails. This was a bug in the past too, so could you please address it? With the box checked, only one email should go out to the admin and one to the user.

    Thanks