HUBSPOT_REMOVECONTACTFROMLIST::remove_contact_from_list( $user_id,  $action_data,  $recipe_id,  $args )

Action validation function.


Return Return

(mixed)


Source Source

File: src/integrations/hubspot/actions/hubspot-removecontactfromlist.php

	public function remove_contact_from_list( $user_id, $action_data, $recipe_id, $args ) {

		$helpers = Automator()->helpers->recipe->hubspot->options;

		$email = trim( Automator()->parse->text( $action_data['meta']['HUBSPOTEMAIL'], $recipe_id, $user_id, $args ) );
		$list  = trim( Automator()->parse->text( $action_data['meta']['HUBSPOTLIST'], $recipe_id, $user_id, $args ) );

		try {
					
			$response = $helpers->remove_contact_from_list( $list, $email, $action_data );
			
			Automator()->complete_action( $user_id, $action_data, $recipe_id );

		} catch ( \Exception $e ) {
			$helpers->log_action_error( $e->getMessage(), $user_id, $action_data, $recipe_id );
		}
	}