Automattic\WooCommerce\Internal\Admin\Schedulers

MailchimpScheduler::make_request()publicWC 1.0

Make an HTTP request to the API.

Method of the class: MailchimpScheduler{}

No Hooks.

Return

Mixed.

Usage

$MailchimpScheduler = new MailchimpScheduler();
$MailchimpScheduler->make_request( $store_email );
$store_email(string) (required)
Email address to subscribe.

MailchimpScheduler::make_request() code WC 7.3.0

public function make_request( $store_email ) {
	if ( true === defined( 'WP_ENVIRONMENT_TYPE' ) && 'development' === constant( 'WP_ENVIRONMENT_TYPE' ) ) {
		$subscribe_endpoint = self::SUBSCRIBE_ENDPOINT_DEV;
	} else {
		$subscribe_endpoint = self::SUBSCRIBE_ENDPOINT;
	}

	return wp_remote_post(
		$subscribe_endpoint,
		array(
			'user-agent' => 'WooCommerce/' . WC()->version . '; ' . get_bloginfo( 'url' ),
			'method'     => 'POST',
			'body'       => array(
				'email' => $store_email,
			),
		)
	);
}