AC_ANNON_ADDTAG::setup_action()

Setup Action.


Return Return

(Uncanny_Automatorvoid.)


Source Source

File: src/integrations/active-campaign/actions/ac-annon-addtag.php

	protected function setup_action() {

		$this->set_integration( 'ACTIVE_CAMPAIGN' );
		$this->set_action_code( $this->prefix . '_CODE' );
		$this->set_action_meta( $this->prefix . '_META' );
		$this->set_is_pro( false );
		$this->set_requires_user( false );

		/* translators: Action - WordPress */
		$this->set_sentence(
			sprintf(
				/* translators: Action sentence */
				esc_attr__( 'Add {{a tag:%1$s}} to {{a contact:%2$s}}', 'uncanny-automator' ),
				$this->get_action_meta(),
				$this->prefix . '_CONTACT_ID' . ':' . $this->get_action_meta()
				//'WPTAXONOMYTERM' . ':' . $this->trigger_meta,
			)
		);

		/* translators: Action - WordPress */
		$this->set_readable_sentence( esc_attr__( 'Add {{a tag}} to {{a contact}}', 'uncanny-automator' ) );

		$options_group = array(
			$this->get_action_meta() => array(
				array(
					'option_code'           => $this->get_action_meta(),
					/* translators: Tag field */
					'label'                 => esc_attr__( 'Tag', 'uncanny-automator' ),
					'input_type'            => 'select',
					'supports_custom_value' => false,
					'required'              => true,
					'is_ajax'               => true,
					'endpoint'              => 'active-campaign-list-tags',
					'fill_values_in'        => $this->get_action_meta(),
				),
				array(
					'option_code' => $this->prefix . '_CONTACT_ID',
					/* translators: Contact field */
					'label'       => esc_attr__( 'Email', 'uncanny-automator' ),
					'placeholder' => esc_attr__( 'me@domain.com', 'uncanny-automator' ),
					'input_type'  => 'email',
					'required'    => true,
				),
			),
		);

		$this->set_options_group( $options_group );

		$this->register_action();

	}