FCRM_USER_TO_LIST::define_action()

Define and register the action by pushing it into the Automator object


Source

File: src/integrations/fluent-crm/actions/fcrm-user-to-list.php

	public function define_action() {

		$action = array(
			'author'             => Automator()->get_author_name(),
			'support_link'       => Automator()->get_author_support_link( $this->action_code, 'integration/fluentcrm/' ),
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			/* translators: Action - LearnDash */
			'sentence'           => sprintf( esc_attr_x( 'Add the user to {{lists:%1$s}}', 'Fluent Forms', 'uncanny-automator' ), $this->action_meta ),
			/* translators: Action - LearnDash */
			'select_option_name' => esc_attr_x( 'Add the user to {{lists}}', 'Fluent Forms', 'uncanny-automator' ),
			'priority'           => 10,
			'accepted_args'      => 1,
			'execution_function' => array( $this, 'list_to_user' ),
			'options'            => [
				Automator()->helpers->recipe->fluent_crm->options->fluent_crm_lists( null, $this->action_meta, [ 'supports_multiple_values' => true ] ),
			],
		);
		Automator()->register->action( $action );
	}