ANON_MAILCHIMP_CONTACT_ADDED::trigger_conditions( $args )

Trigger conditions.


Description Description

Only run the trigger if audience is set to ‘Any’ or if audience id is equals to the one set in the recipe.


Top ↑

Return Return

(Uncanny_Automatorvoid.)


Source Source

File: src/integrations/mailchimp/triggers/anon-mailchimp-contact-added.php

	protected function trigger_conditions( $args ) {

		// If args is empty, bail.
		if ( ! is_array( $args ) ) {
			return;
		}

		// First element of args is the MailChimp event data.
		$event = $args[0];

		// Match 'Any audience' condition.
		$this->do_find_any( true );

		// Match specific condition.
		$this->do_find_this( $this->get_trigger_meta() );

		// Find in list id.
		$this->do_find_in( array( $event['data']['list_id'] ) );

		Automator()->helpers->recipe->mailchimp->options->log( '[3/3. Trigger conditions]. Setting trigger conditions. Will run if audience is set to `Any` or if audience matches the selected audience value. Check recipe log.' );

	}