Mailchimp_Helpers::init_webhook()

Initialize the webhook rest api endpoint.

Contents


Return Return

(Uncanny_Automatorvoid.)


Source Source

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

	public function init_webhook() {
		if ( $this->is_webhook_enabled() && $this->has_connection_data() ) {
			register_rest_route(
				AUTOMATOR_REST_API_END_POINT,
				$this->webhook_endpoint,
				array(
					'methods'             => array( 'POST', 'GET' ),
					'callback'            => array( $this, 'webhook_callback' ),
					'permission_callback' => array( $this, 'validate_webhook' ),
				)
			);
		}
	}