How to generate/pull a report from Appointments+ data

We are hoping to be able to reach out to customers around the anniversary of their appointment with us. Is there a way to pull a report from the booking data? We use Google Calendar to help track and double check bookings so if there is something that direction we are open to it! We currently use the follow up email code and it’s been great! I’m not sure if having a second version of that added but based on days rather than hours might work. Here is the link to what we are using

Details about us: We use the app for birthday party bookings. We would like to send an email a month prior to the anniversary of their previous booking date.

Thanks so much!

Suzy B

  • Suzy
    • Design Lord, Child of Thor

    Thank you Kasia that is exactly what I was looking for! I don’t alway trust my limited coding skills to make the changes necessary to duplicate what we had and just “change” a few things. I would have broke it for sure!

    Thanks again =)

    Suzy B

  • Suzy
    • Design Lord, Child of Thor

    I’ve implemented this on our test site and it’s not generating the email. I’ve got management to agree to the first version which is obviously much easier to test. I booked a party for August 3, 2015 12:00 pm hoping it would kick out the 11 month reminder on or around Sept 3rd. But nothing happened. I got the confirmation, reminder and the immediate follow up email ( that goes out 24 hours after). Nothing was in the settings log other than the three emails I listed.

    Am I testing it wrong? Possible the I need a bigger window for there reminder to go out? Any suggestions are welcome! I’ve granted access to our test site.

  • Nithin
    • Support Wizard

    Hi Suzy,

    Hope you are doing good today. :slight_smile:

    Did the plugin had edits other than this code snippets? Was there any other customization done to the plugin? I was able to notice that the snippet is quite old, and the edits provided by Kasia might not work as expected, as the plugin had been rewritten since April, and chances are that the code won’t function as expected. Is it possible to update the plugin to the latest version? So that I could ping our coding experts to give a look regarding this one.

    Please do let us know whether this is possible, so that we could give a closer look. Have a nice day. :slight_smile:

    Kind Regards,


  • Suzy
    • Design Lord, Child of Thor

    As I’ve mentioned previously (I should start putting it in every posting) we cannot update our app due to the fact that bookings were not removing the time slot from other same time providers. Until that is fixed (and I’ve been told there is no ETA) we cannot update.

    The code Jude had originally done for us was modified a very little bit. So the code she was basing her’s off is a little different. The code snippet he did for us ages ago still works. I am running on test on Kasia’s code by just changing the things Jude had changed.

    Here is Jude’s altered code (from what Kasia linked above):

    add_filter( ‘app_message_headers’, ‘app_custom_header’ );function app_custom_header() { $admin_email = ‘’; $blogname = wp_specialchars_decode(get_option(‘blogname’:wink:, ENT_QUOTES); $content_type = apply_filters(‘app-emails-content_type’, ‘text/plain’:wink:; if (!(defined(‘APP_EMAIL_DROP_LEGACY_HEADERS’:wink: && APP_EMAIL_DROP_LEGACY_HEADERS)) { $message_headers = “MIME-Version: 1.0n” . “From: {$blogname}” . ” <{$admin_email}>n” . “Reply-To: <” . $blogname . “> <” . $admin_email . “>n” . “Content-Type: {$content_type}; charset=”” . get_option(‘blog_charset’:wink: . “”n”; } else { $message_headers = “MIME-Version: 1.0n” . “Reply-To: <” . $blogname . “> <” . $admin_email . “>n” . “Content-Type: {$content_type}; charset=”” . get_option(‘blog_charset’:wink: . “”n” ; add_filter(‘wp_mail_from’, create_function(”, “return ‘{$admin_email}’;”:wink:); add_filter(‘wp_mail_from_name’, create_function(”, “return ‘{$blogname}’;”:wink:); } return $message_headers;


    function follow_up( $value ) {

    global $wpdb, $appointments;

    $a = $appointments;

    // Double check if A+ is active

    if ( !is_object( $a ) )


    // Follow up time in hours

    $hour = 23;

    // Follow up email subject

    $subject = ‘We Would Like to Hear From You!’;

    // Follow up email message

    $message = ‘<center><img src=”” width=”221″ height=”129″></center>

    Thank you for having your party with Kids Club Fun and Fitness. We would like to see how we did! Below is a link to a survey that will let us know how our performance was.

    Birthday Party Feedback

    Warm Regards,

    Kids Club Fun and Fitness


    $results = $wpdb->get_results( “SELECT * FROM ” . $a->app_table . ” WHERE note NOT LIKE ‘%Follow up sent%’ AND

    status=’completed’ AND DATE_ADD(start, INTERVAL “.$hour.” HOUR) <‘” . date (“Y-m-d H:i:s”, $a->local_time ). “‘ ” );

    if ( $results ) {

    foreach ( $results as $r ) {

    // Send email

    if ( wp_mail( $r->email, $subject, $message, $a->message_headers() ) ) {

    // Save so that we don’t send email again

    $wpdb->update ( $a->app_table,

    array( ‘note’ => $r->note . ‘ Follow up sent’ ),

    array( ‘ID’ => $r->ID ),

    array ( ‘%s’ )


    // Log here for better results

    $appointments->log ( sprintf( “Follow up email sent to %s for appointment ID %s” , $r->email , $r->ID ) ) ;





    add_action( ‘update_option_app_last_update’, ‘follow_up’ );

    So there are a few different things in this code and I’m trying them out. I’ll report back!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.