ANON_FCRM_CONTACT_STATUS_UPDATED::process_trigger( array $matched_recipe_ids = array(), object $uncanny_automator, Uncanny_AutomatorFCRM_USER_STATUS_UPDATED $trigger, object $subscriber = null )

Processes our trigger.


Parameters Parameters

$matched_recipe_ids

(array) (Optional) The matching recipe ids.

Default value: array()

$uncanny_automator

(object) (Required) The Automator's object.

$trigger

(Uncanny_AutomatorFCRM_USER_STATUS_UPDATED) (Required) The trigger.

$subscriber

(object) (Optional) The subscriber object.

Default value: null


Top ↑

Return Return

(void)


Source Source

File: src/integrations/fluent-crm/triggers/anon-fcrm-contact-status-updated.php

	public function process_trigger( $matched_recipe_ids = array(), $uncanny_automator, FCRM_USER_STATUS_UPDATED $trigger, $subscriber = null ) {
		if ( ! empty( $matched_recipe_ids ) ) {
			foreach ( $matched_recipe_ids as $matched_recipe_id ) {
				$args = array(
					'code'             => $trigger->get_trigger_code(),
					'meta'             => $trigger->get_trigger_meta(),
					'user_id'          => $subscriber->user_id,
					'recipe_to_match'  => $matched_recipe_id['recipe_id'],
					'trigger_to_match' => $matched_recipe_id['trigger_id'],
					'ignore_post_id'   => true,
				);
				$args = Automator()->maybe_add_trigger_entry( $args, false );
				if ( $args ) {
					foreach ( $args as $result ) {
						if ( true === $result['result'] && $result['args']['trigger_id'] && $result['args']['get_trigger_id'] ) {
							Automator()->maybe_trigger_complete( $result['args'] );
						}
					}
				}
			}
		}
	}