Settings > Modules) if (!moduleOn('calendar')) { http_response_code(403); echo json_encode(['success' => 'False', 'message' => moduleOffText('calendar')]); exit(); } $update_count = false; $event_action = 'edit'; require_once 'event_find.php'; if ($event_row) { $event_id = intval($event_row['event_id']); $refuse = ''; if (!calendarCanEmail()) { $refuse = 'Email is not set up, so there is nothing to send the invitation with.'; } else { $not_invited = array_values(array_filter(calendarEventAttendees($event_id), function ($attendee) { return empty($attendee['attendee_invited_at']); })); $emailed = calendarSendInvites($event_row, 'invite', $not_invited) + calendarSendInvites($event_row, 'update', calendarInvitedAttendees($event_id)); if (!$emailed) { $refuse = 'Nobody on this event has an email address to send it to.'; } } if ($refuse !== '') { http_response_code(400); $return_arr['success'] = "False"; $return_arr['message'] = $refuse; echo json_encode($return_arr); exit(); } $update_count = 1; $return_arr['emailed'] = $emailed; logAudit("API", "Success", "Emailed the invitation for " . escapeSql($event_row['event_title']) . " via API ($api_key_name)", $client_id); } // Output require_once '../update_output.php';