Active_Campaign_Settings::set_properties()

Sets up the properties of the settings page


Source

File: src/integrations/active-campaign/settings/settings-active-campaign.php

	protected function set_properties() {

		$this->set_id( 'active-campaign' );

		$this->set_icon( 'active-campaign' );

		$this->set_name( 'ActiveCampaign' );

		$this->register_option( 'uap_active_campaign_api_url' );

		$this->register_option( 'uap_active_campaign_api_key' );

		$this->register_option( 'uap_active_campaign_settings_timestamp' );

		$this->register_option( 'uap_active_campaign_enable_webhook' );

		$this->set_js( '/active-campaign/settings/assets/script.js' );

		$this->account_url = get_option( 'uap_active_campaign_api_url', '' );

		$this->api_key = get_option( 'uap_active_campaign_api_key', '' );

		$this->users = false;

		if ( ! empty( $this->api_key ) && ! empty( $this->account_url ) ) {

			$this->users = $this->helpers->get_users(); 

		}
		
		$this->is_connected = ! empty( $this->users[0]['email'] );

		$this->set_status( $this->is_connected ? 'success' : '' );

	}