Back to Developer Guides

This guide applies to:

  • Basic Edition
  • Plus Edition
  • Pro Edition
  • Business Edition

Description

WordPress Hook that fires once there is a newly booked appointment, including appointments with a changed status from pending_payment to booked.

Placement

This code should be placed in the file of your custom plugin.

Source Code

This action is located in the SSA_Hooks::maybe_do_appointment_booked_hook() function in class-hooks.php.


Usage for ssa/appointment/booked

add_action('ssa/appointment/booked', 'new_function_name', 10, 4);

Parameters

  • $appointment_id int
    The ID of the newly booked appointment.
  • $data array
    The data of the newly booked appointment, which includes several keys, such as appointment_type_id, status, date_created, and date_modified. The rest of the keys can be found in SSA_Appointment_Model::schema in class-appointment-model.php.
  • $data_before array
    The data of the newly booked appointment before it has been booked, which includes several keys, such as appointment_type_id, status, date_created, and date_modified. The rest of the keys can be found in SSA_Appointment_Model::schema in class-appointment-model.php.
  • $response 
    The response of booking the appointment.

Example – Create a CRM lead when an appointment is booked

add_action('ssa/appointment/booked', 'sync_ssa_appointment_to_crm', 10, 4);

function sync_ssa_appointment_to_crm($appointment_id, $data, $data_before, $response)
{
    $api = new MyCRM();
    $api->createLead( $appointment_id, $data );
}

Still stuck?

File a support ticket with our five-star support team to get more help.

File a ticket

  • This field is for validation purposes and should be left unchanged.
  • Please provide any information that will be helpful in helping you get your issue fixed. What have you tried already? What results did you expect? What did you get instead?

Related Guides