AC_ANNON_ADD::setup_action()

Setup Action.


Return Return

(Uncanny_Automatorvoid.)


Source Source

File: src/integrations/active-campaign/actions/ac-annon-add.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( esc_attr__( 'Add {{a contact:%1$s}} to ActiveCampaign', 'uncanny-automator' ), $this->get_action_meta() ) );

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

		$options_group = array(
			$this->get_action_meta() => array(
				array(
					'option_code' => $this->get_action_meta(),
					/* translators: Email address */
					'label'       => esc_attr__( 'Email address', 'uncanny-automator' ),
					'input_type'  => 'email',
					'required'    => true,
				),
				array(
					'option_code' => $this->prefix . '_FIRST_NAME',
					/* translators: First name */
					'label'       => esc_attr__( 'First name', 'uncanny-automator' ),
					'input_type'  => 'text',
					'required'    => true,
				),
				array(
					'option_code' => $this->prefix . '_LAST_NAME',
					/* translators: Last name */
					'label'       => esc_attr__( 'Last name', 'uncanny-automator' ),
					'input_type'  => 'text',
					'required'    => true,
				),
				array(
					'option_code' => $this->prefix . '_PHONE',
					'label'       => esc_attr__( 'Phone number', 'uncanny-automator' ),
					'placeholder' => esc_attr__( '(+00) 987 123 4567', 'uncanny-automator' ),
					'input_type'  => 'text',
				),
			),
		);

		$this->set_options_group( $options_group );

		$this->register_action();

	}