Appointments+ Custom Query

Can anyone please tell me which function to trigger to cancel an appointment programmatically in the Appointments+ plugin?

  • Willi
    • Flash Drive

    Hi Ash,

    This is great thankyou, I have email/sms gateway setup that will allow me to send emails to a certain address with content based on the email confirmation sent from app+, and i can use cpanel to forward the email to a php script.

    Would you be able to help with:
    1) creating a app+ confirmation email that sends the $app_id
    2) creating a php script that would trigger the above function (cancelling an appointment) when it receives an email containing the $app_id?

    Cheers
    Willi

  • Willi
    • Flash Drive

    Hi Ash,

    1) Yes I have the confirmation emails sending
    2) I know I can pipe an email to a php file and I know I can send that email, I just don't know how to make that php script trigger the cancellation finction for an $app_id contained in the email when the email is received.

    Cheers

  • Ash
    • WordPress Hacker

    Hello Willi

    When you pipe the email to a php file, can you pass the app_id to the php script? If so, then you can include all the wordpress function in that file.

    You can create a file and include just a line:

    require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php');

    That should actually be the correct path to wp-load.php. And then, you can use all of the wordpress' functions in that file.

    About the app_id, maybe you can include that in the email subject or reply-to email address and fetch from there?

    Have a nice day!

    Cheers,
    Ash

  • Willi
    • Flash Drive

    Hi Ash,

    Thanks for your help with this. I'm not exactly sure what you mean about the wp-load.php stuff. If the function you provided in your first email is the one I need to trigger, then what functions from wp-load.php do I need?

    Can you give me an example of how you would trigger the required function/s when an email, which contains the app_id, is piped to the php file?

    I'll talk to the sms gateway people about where I can include the app_id, but if you could assume it will be in the body of the email that would be best.

  • Ash
    • WordPress Hacker

    Well, I am not sure about piping technology either :slight_frown:

    What I can help with the function only. You may need to talk with the hosting if they can help with piping an email to a file and pass a variable to that file. If you can manage that part, I can help with the function thing.

    Some hosting has a similar feature built in, so they might help with that. Have a nice day!

    Cheers,
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.