Twilio_Settings::set_properties()

Sets up the properties of the settings page


Source

File: src/integrations/twilio/settings/settings-twilio.php

	protected function set_properties() {

		$this->set_id( 'twilio-api' );

		$this->set_icon( 'twilio' );

		$this->set_name( 'Twilio' );

		$this->register_option( 'uap_automator_twilio_api_account_sid' );
		$this->register_option( 'uap_automator_twilio_api_auth_token' );
        $this->register_option( 'uap_automator_twilio_api_phone_number' );
		$this->register_option( 'uap_automator_twilio_api_settings_timestamp' );

		$this->user = false;

		try {
			
			$this->client = $this->helpers->get_client();
			$this->user = $this->helpers->get_user();

			if ( empty( $this->user['sid'] ) ) {
				throw new \Exception( __( 'User account error', 'uncanny-automator' ) );
			}

			$this->is_connected = true;
		} catch ( \Exception $e) {
			$this->user = array();
			$this->is_connected = false;
		}

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

	}