MAILPOET_ADDUSER_A::define_action()

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


Source Source

File: src/integrations/mailpoet/actions/mailpoet-adduser-a.php

	public function define_action() {



		$action = array(
			'author'             => Automator()->get_author_name( $this->action_code ),
			'support_link'       => Automator()->get_author_support_link( $this->action_code, 'integration/mailpoet/' ),
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			/* translators: Action - MailPoet */
			'sentence'           => sprintf( esc_attr__( 'Add the user to {{a list:%1$s}}', 'uncanny-automator' ), $this->action_meta ),
			/* translators: Action - MailPoet */
			'select_option_name' => esc_attr__( 'Add the user to {{a list}}', 'uncanny-automator' ),
			'priority'           => 10,
			'accepted_args'      => 1,
			'execution_function' => array( $this, 'mailpoet_add_user_to_list' ),
			'options'            => array(),
			'options_group'      => [
				$this->action_meta    =>
					[
						Automator()->helpers->recipe->mailpoet->options->get_all_mailpoet_lists( esc_attr__( 'List', 'uncanny-automator' ), $this->action_meta ),
						Automator()->helpers->recipe->field->text_field( 'USERADDEDTOLIST_CONFIRMATIONEMAIL', esc_attr__( 'Add the user directly to the list - Do not send confirmation email', 'uncanny-automator' ), true, 'checkbox', '', false ),
					]
			],
		);

		Automator()->register->action( $action );
	}