Send Cancellation email notifications

Was using the following code as found in the forums:

add_action( 'app-appointments-appointment_cancelled', 'app_custom_send_email_admin_cancellation' );
function app_custom_send_email_admin_cancellation( $app_id ){
global $appointments;
global $wpdb;

$sql = "SELECT * from " . $wpdb->prefix . "app_appointments where ID = '".$app_id."'";
$app = $wpdb->get_row( $sql, OBJECT );

$date_time = mysql2date($appointments->datetime_format, $app->start);
$client_name = $appointments->get_client_name( $app_id );
$provider_name = $appointments->get_worker_name( $app->worker );
$headers = array('Content-Type: text/html; charset=UTF-8');

$multiple_recipients = array(
'An Appointment was cancelled',
'The following appointment was cancelled by the user. <br /><br />
Name: '.$client_name.'<br />
Date/Time: '.$date_time.'<br />
Location: '.$provider_name,

But after the plugin update, it's throwing a 500 internal error:

[07-Oct-2017 04:02:21 UTC] PHP Fatal error: Call to undefined method Appointments::get_worker_name() in /home/xxxx/public_html/wp-content/mu-plugins/myCustomCode.php on line 110
  • Panos
    • SLS

    Hi Vamsi Pulavarthi ,

    Could you please replace :

    $provider_name = $appointments->get_worker_name( $app->worker );


    $provider_name = appointments_get_worker_name( $app->worker );

    The get_worker_name method was deprecated some versions ago. This should fix your issue :slight_smile:

    Please let us know if you still got any trouble with this!


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.