In this document:
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 asappointment_type_id, status, date_created,
anddate_modified
. The rest of the keys can be found inSSA_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 asappointment_type_id, status, date_created,
anddate_modified
. The rest of the keys can be found inSSA_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 );
}
Related Guides
-
Developer Settings
-
New Booking App
-
ssa/appointments/customer_information/get_defaults Filter
-
ssa/templates/get_template_vars Filter