ZOOM_WEBINAR_UNREGISTERUSERLESS::zoom_webinar_unregister_user( $user_id, $action_data, $recipe_id, $args )
Validation function when the action is hit
Contents
Parameters Parameters
- $user_id
-
(Required)
- $action_data
-
(Required)
- $recipe_id
-
(Required)
Source Source
File: src/integrations/zoom-webinar/actions/zoom-webinar-unregisteruserless.php
public function zoom_webinar_unregister_user( $user_id, $action_data, $recipe_id, $args ) { $webinar_key = Automator()->parse->text( $action_data['meta'][ $this->action_meta ], $recipe_id, $user_id, $args ); $email = Automator()->parse->text( $action_data['meta']['EMAIL'], $recipe_id, $user_id, $args ); if ( empty( $email ) || ! is_email( $email ) ) { $error_msg = __( 'Email address is missing or invalid.', 'uncanny-automator' ); $action_data['do-nothing'] = true; $action_data['complete_with_errors'] = true; Automator()->complete_action( $user_id, $action_data, $recipe_id, $error_msg ); return; } if ( empty( $webinar_key ) ) { $error_msg = __( 'Webinar not found.', 'uncanny-automator' ); $action_data['do-nothing'] = true; $action_data['complete_with_errors'] = true; Automator()->complete_action( $user_id, $action_data, $recipe_id, $error_msg ); return; } if ( ! empty( $webinar_key ) ) { $webinar_key = str_replace( '-objectkey', '', $webinar_key ); } $result = Automator()->helpers->recipe->zoom_webinar->unregister_user( $email, $webinar_key ); if ( ! $result['result'] ) { $error_msg = $result['message']; $action_data['do-nothing'] = true; $action_data['complete_with_errors'] = true; Automator()->complete_action( $user_id, $action_data, $recipe_id, $error_msg ); return; } Automator()->complete_action( $user_id, $action_data, $recipe_id ); }
Expand full source code Collapse full source code View on Github