Can I cancel an appointment without having to login and go to the Appointments Page?

Hello,

I noticed that Clients are allowed to cancel their appointments via the short code "allow_cancel" under the "app_my_appointments". I was wondering if the service provider could cancel appointments in the same fashion. I added the shortcode to the providers page, but do not see the option to cancel appointments. Please let me know.

page located here:
http://nawatmassagetherapy.com/monicaschedule/

script for page is:

[app_worker_monthly_calendar worker_id="2"]

[app_my_appointments provider="1" provider_id="2" allow_cancel="1"]

Also, Is there a way to put a minimum cancellation period in which a client can cancel. (ie client cannot cancel within 24 hours of appointment.)

Thanks,
Dominic

  • Michael Bissett
    • Recruit

    Hey @dcayme1, hope you're doing well today! :slight_smile:

    I noticed that Clients are allowed to cancel their appointments via the short code "allow_cancel" under the "app_my_appointments". I was wondering if the service provider could cancel appointments in the same fashion.

    There doesn't look to be a way of allowing the service provider to cancel via that shortcode, he/she would need to have the admin of the site to cancel the appointment.

    Also, Is there a way to put a minimum cancellation period in which a client can cancel. (ie client cannot cancel within 24 hours of appointment.)

    That's not a feature at present, but it has been brought up before, and it's definitely a feature that'd be useful to have.

    I've moved this thread over to the Features and Feedback section, so that way others can provide their +1 for this feature.

    Let me know if I can be of further assistance please. :slight_smile:

    Regards,
    Michael

  • dcayme1
    • Site Builder, Child of Zeus

    Michael, Thanks for the response. Can the code be modified so that it allows Service Providers to cancel via that shortcode? If not, is there any other way to have service providers cancel an appointment without having to bother the admin of the site?

  • dcayme1
    • Site Builder, Child of Zeus

    Ash,

    Thanks for the response. Is there a way to have the cancellation link (sent with the confirmation email to the client as well as a copy to the service provider) sent only to the service provider and not the client?

    -Dom

  • Ash
    • WordPress Hacker

    Hello @dcayme1

    I hope you are well today.

    No, the email will be sent to client and the provider both. For this you just need to enter "CANCEL" in the email content from Appointments > Settings > Notification Settings section.

    You may also try to use "app_new_appointment" hook to create an external function send email to the associate provider.

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

    Cheers
    Ash

  • dcayme1
    • Site Builder, Child of Zeus

    Thanks Ash,

    How do i use the "app_new_appointment" hook to create an external function to send an additional email to the associated provider which would include a cancellation link.

    Where do i put this and what details do i specify for this to work?

    -Dom

  • Michael Bissett
    • Recruit

    Hey @dcayme1,

    You can reference this post from the developer for Appointments+, that should help you get started on coding this:

    https://premium.wpmudev.org/forums/topic/how-do-i-send-notification-of-appointments-to-two-email-addresses#post-637753

    However, as for getting it entirely set up the way you're wanting it to, I'll have to call in our SLS staff on this one, as they're more talented in this realm of coding than I am. :slight_smile:

    They do have more on their plate than we do though, so this ticket may take longer than usual.

    Regards,
    Michael

  • Hoang Ngo
    • Code Slayer

    Hi @ dcayme1,

    I hope you are well today.

    Here is an example for sending another email when new appointment created. Please add this code to your theme functions.php or use mu-plugins

    function my_app_send_additional_emails($app_id)
    {
        global $appointments;
        wp_mail(
            'additional_one@email.com',
            'Subject line',
            'Email message body' . $appointments->add_cancel_link('Cancel', $app_id)
        );
    }
    
    add_action("app_new_appointment", "my_app_send_additional_emails");

    Please give it a try and let us update :slight_smile:

    Best regards,
    Hoang Ngo

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.