It’s for Appointment added trigger. If you use Appointment published use
'wordpress/booked_appointments/published'
instead of
'wordpress/booked_appointments/added'
or comment this code
if ( $trigger->get_slug() != 'wordpress/booked_appointments/added' ) { return; }