Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Hubspot_Helpers::remove_contact_from_list( mixed $list, mixed $email,  $action_data )

remove_contact_from_list


Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Parameters Parameters

$list

(Required)

$email

(Required)


Top ↑

Return Return

(void)


Source Source

File: src/integrations/hubspot/helpers/hubspot-helpers.php

	public function remove_contact_from_list( $list, $email, $action_data ) {
		if ( empty( $email ) ) {
			throw new \Exception( __( 'Email is missing', 'uncanny-automator' ) );
		}
		if ( empty( $list ) ) {
			throw new \Exception( __( 'List is missing', 'uncanny-automator' ) );
		}
		$params = array(
			'action' => 'remove_contact_from_list',
			'email'  => $email,
			'list'   => $list,
		);
		$response = $this->api_request( $params, $action_data );
		// If the email was not found in contacts
		if ( ! empty( $response['data']['discarded'] ) ) {
			throw new \Exception( __( 'Contact with such email address was not found in the list', 'uncanny-automator' ) );
		}
		return $response;
	}