AUDIENCE_UNSUBSCRIBEAUSER::define_action()

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


Source Source

File: src/integrations/mailchimp/actions/audience-unsubscribeauser.php

	public function define_action() {

		global $uncanny_automator;

		$action = array(
			'author'             => $uncanny_automator->get_author_name( $this->action_code ),
			'support_link'       => $uncanny_automator->get_author_support_link( $this->action_code, 'knowledge-base/mailchimp/' ),
			'is_pro'             => false,
			'integration'        => self::$integration,
			'code'               => $this->action_code,
			'sentence'           => sprintf( __( 'Unsubscribe the user from {{an audience:%1$s}}', 'uncanny-automator' ), $this->action_meta ),
			'select_option_name' => __( 'Unsubscribe the user from {{an audience}}', 'uncanny-automator' ),
			'priority'           => 10,
			'accepted_args'      => 1,
			'execution_function' => array( $this, 'unsubscribe_audience_member' ),
			'options_group'      => array(
				$this->action_meta => array(
					$uncanny_automator->helpers->recipe->mailchimp->options->get_all_lists(
						__( 'Audience', 'uncanny-automator' ),
						'MCLIST'
					),
					$uncanny_automator->helpers->recipe->mailchimp->options->get_double_opt_in(
						__( 'Delete subscriber from MailChimp?', 'uncanny-automator' ),
						'MCDELETEMEMBER',
						array(
							'description' => __( 'Yes, delete from MailChimp, No, only unsubscribe from audience', 'uncanny-automator' ),
						)
					),
				),
			),
		);

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