email notification for cancelled appointments

Is it possible to receive email notification of an appointment cancelled by a client. I have activated a cancellation link which makes the appointment available again on the front end but unless the client notifies me directly, I have no idea that the appointment has been cancelled.

  • Jack Kitterhing
    • Code Norris

    Hi there Kevin,

    Hope you're well today and thanks for your question.

    That isn't possible out of the box currently, but we are looking into this for a future release.

    I believe the developer may have a code snippet though for this, I'll include him here @Vladislav :slight_smile:

    Thanks!

    Kind Regards
    Jack.

  • Vladislav
    • Dead Eye Dev

    Hello,

    Adding something like this to your functions.php should notify the site admin (i.e. you) when an appointment gets cancelled:

    function my_app_email_on_appointment_cancelled ($app_id) {
    	global $appointments;
    	$to = $appointments->get_admin_email();
    	wp_mail($to, 'An appointment has been cancelled', "An appointment with ID {$app_id} has just been cancelled.");
    }
    add_action('app-appointments-appointment_cancelled', 'my_app_email_on_appointment_cancelled');

    The notification email will be very simple and will just include the barebones information that an appointment has been cancelled. I hope this helps.

  • Kevin
    • The Incredible Code Injector

    Barebones is perfect as all I need is to know that the appointment is cancelled. The only other problem will be to implement it. I'm the admin...but I can't do code very well at all so I don't know where to find the original code to insert this. Any ideas?

  • Kevin
    • The Incredible Code Injector

    Big MIstake!!! something happened.
    Parse error: syntax error, unexpected '{' in /users13/domains/simplyfitcanada.com/web/wp-content/themes/empire/functions.php on line 26 now I can't get to my site! I also don't think My site is visible anymore. HELP

  • Jack Kitterhing
    • Code Norris

    Hi there @Kevin,

    Hope you're well today, sorry about the delay here.

    That code should go into your functions.php and not your custom css, can you remove your custom css file or remove the code from the file.

    You'll need to use file manager or FTP and then this will work correctly.

    Any issues, doing this please let me know, I'm here to help.

    Thanks!

    Kind Regards
    Jack.

  • Kevin
    • The Incredible Code Injector

    Morning Jack,
    I definitely needed help. The whole site crashed. I had a friend look and he was able to replace a line of code that was corrupted and now things are back to normal. With my limited knowledge of coding I'm scared to screw things up again. Yes..any help would be appreciated.
    I know in the long run that this little addition will make things WAY easier for me when clients cancel their appointments but I don't think that I'm able to do it.

  • Kevin
    • The Incredible Code Injector

    Hey Jack.
    Thank you for the hard work.
    I do still need half hour sessions because it is a service that I offer. The problem is, is that when a client wants to reserve 1 hour at 10:30 he can't. He has to reserve two half hour sessions instead. Although if he wants to reserve an hour session at 11 he can. Understand?
    Now..if we can fix that , we've already fixed the email cancellation thing...all we need now is to find a way to add recurring sessions so as not to book monday , wednesday and friday at 11 for the next three months. Someone should have thought of a way by now to fix this seeing as there are soooo many of your customers who actually request this.
    Anyways..thanks again Jack, so far...nobody has cancelled a session so I'll take your word that everything is working fine.
    Have a great day!

  • Michael Bissett
    • Recruit

    Hey @Kevin, hope you're doing well today. :slight_smile:

    I do still need half hour sessions because it is a service that I offer. The problem is, is that when a client wants to reserve 1 hour at 10:30 he can't. He has to reserve two half hour sessions instead. Although if he wants to reserve an hour session at 11 he can. Understand?

    Understood. :slight_smile:

    If you go to Appointments -> Settings, and click on the Add-ons tab, you'll see the "Durations" addon. Activate that, and then click on the General tab.

    Close to the bottom of the "Time Settings" section, you'll see "Time slot calculus method". Set that to "Minimum time based appointment duration calculus (legacy)". That will allow you to be able to have the available times based on your time base, instead of the service time specified.

    Since you're wanting to show 30 minute intervals on the appointment scheduler (while still keeping the service times set to their proper times), have "Time base (minutes)" (located in the General tab as well) to 30.

    Hope that helps!

    Regards,
    Michael

  • Kevin
    • The Incredible Code Injector

    Hey Jack,
    OK here is the issue with the appointment cancellations.
    When clients book and appointment it works and the appointment shows on the front end and I receive an e-mail confirming the appointment. Then when the client cancels an appointment, it disappears from the front end and all is good but I STILL don't receive any email confirming that the client cancelled. The only way that I know is if I go and look at the calendar in the front end and see the time slot available.....not good.

  • Michael Bissett
    • Recruit

    Hey @Kevin, hope you're doing well today. :slight_smile:

    On the appointment cancellation issue, I've called @Jack Kitterhing back to this thread, he should be here shortly.

    While waiting for him though, I'd like to ask if the fix I suggested for displaying the times on the scheduler worked for you, haven't heard back from you on that yet.

    Let me know if I can be of further assistance here.

    Regards,
    Michael

  • Jack Kitterhing
    • Code Norris

    Hi there Kevin,

    Hope you're well today, sorry to hear the cancellation isn't working correctly still with the email.

    Could you re-grant support staff access please and I'll login and check again with my email, just in case something's happening with the email on send.

    All other emails come through correctly? :slight_smile:

    Thank you!

    Kind Regards
    Jack.

  • Kevin
    • The Incredible Code Injector

    Hey Jack.
    Thanks for the fast response. In reply, yes it has been a few day now that all email appointment notifications come through and I'm happy about that. The cancellations work but the notifications don't come through.
    You have my permission to go and see. All passwords you should still have.
    Let me know if you have a problem with anything.

  • Kevin
    • The Incredible Code Injector

    Mike,
    I just did a test of the corrections that you told me to make regarding the half hours. What happens in effect is, YES the half hours show on the calendar and YES now when you book and appointment of 60 minutes at 4:30 it says that your appointment has been made at 4:30 but on the front end of the calendar only a 30 minutes block gets reserved. The other half hour of the appointment is still available.
    Hmmmmmm. still not fixed yet.

    Jack....still waiting on a reply from you about the other problem. If you can't log in which I find surprising just let me know, although you have all the details.

  • Ash
    • WordPress Hacker

    Hi @Kevin

    I have just checked for a 60 mins appointment and it's working fine for me. Please check here: http://www.simplyfitcanada.com/booking-calendar/?app_service_id=4

    You can see a test appointment at May 26 1.30 pm and 2.00 pm is not free.

    The link you shared, please note that, by default a 30 mins service is shown in that calendar.

    Please check and let me know.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

  • Kevin
    • The Incredible Code Injector

    Thank you ash. I received the test. I will check more tomorrow. Now, try to cancel it and see what happens. The appointment will disappear but i don't think I will receive a notification telling me. If by chance I do, I'll let you know.

  • Jack Kitterhing
    • Code Norris

    Hi there @Kevin,

    Hope you're well today and thanks for your patience here.

    Me and the developer have done some testing and the code is working correctly for us, it's possible that the emails are getting spammed, or for some reason just aren't being delivered.

    All other emails such as password reset emails etc get sent correctly?

    Can you test with another email address if possible? :slight_smile:

    Thank you!

    Kind Regards
    Jack.

  • Kevin
    • The Incredible Code Injector

    Morning Jack. Ok I'll try a g mail address. Actually on the weekend i received one cancellation and it worked! I'll keep you informed.
    Thanks for all the work.
    Any news on a possible recurring appointment update?

  • Kevin
    • The Incredible Code Injector

    I am not sure where to change the e-mail that the appointments are directed to. I was also thinking that maybe my server was blocking emails. But wouldn't I get them on my phone if the phone wasn't connected to a wireless network?

  • Patrick
    • Support Monkey

    Hey there @Kevin

    I hope you don't mind me jumping in here.

    You can change the admin email under Settings > General in your wp-admin.

    To change a Service Provider email, go to the user's profile in your wp-admin.

    As for receiving notifications on your wireless device, the answer is unfortnately no. There is as yet no built-in functionality to support SMS notifications.

    However, when connected to a wireless network, you should be able to access your email just as you would on your home computer.

  • Kevin
    • The Incredible Code Injector

    Afternoon Patrick. Thanks for the info. I'm still wondering, if the emails are getting blocked somehow, I don't think it sold matter which email address loo use. They still won't get through.
    On the weekend though i did receive one cancellation notice. I'm just not sure if it was a sporadic accident.

  • Kevin
    • The Incredible Code Injector

    Patrick,Jack, and Ash,
    Two times in a row I have received a cancellation email! I have to log in to see the reference number but that is just fine! Thank you guys for all the hard work. Lets keep our fingers crossed that it lasts.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.