ACF_Admin_Email_Opt_In_Banner::send_opt_inprivateACF 6.8.6

POSTs a prepared opt-in payload to the endpoint that subscribes the email address to ACF updates and news.

Method of the class: ACF_Admin_Email_Opt_In_Banner{}

No Hooks.

Returns

Array|WP_Error. The wp_remote_post response.

Usage

// private - for code of main (parent) class only
$result = $this->send_opt_in( $payload );
$payload(array) (required)
The payload from build_opt_in_payload.

Changelog

Since 6.8.6 Introduced.

ACF_Admin_Email_Opt_In_Banner::send_opt_in() code ACF 6.8.8

private function send_opt_in( $payload ) {
	$url = 'https://api.hsforms.com/submissions/v3/integration/submit/46851451/e420c547-8255-4339-888c-32c58e36a80f';

	return wp_remote_post(
		$url,
		array(
			'timeout' => 10,
			'headers' => array( 'Content-Type' => 'application/json' ),
			'body'    => wp_json_encode( $payload ),
		)
	);
}