AC_TOKENS::parse_tokens( mixed $value, mixed $pieces, mixed $recipe_id, mixed $trigger_data, mixed $user_id, mixed $replace_args )

parse_tokens


Parameters Parameters

$value

(Required)

$pieces

(Required)

$recipe_id

(Required)

$trigger_data

(Required)

$user_id

(Required)

$replace_args

(Required)


Top ↑

Return Return

(void)


Source Source

File: src/integrations/active-campaign/tokens/ac-tokens.php

	public function parse_tokens( $value, $pieces, $recipe_id, $trigger_data, $user_id, $replace_args ) {

		if ( ! is_array( $pieces ) || ! isset( $pieces[1] ) || ! isset( $pieces[2] ) ) {
			return $value;
		}

		if ( 'CONTACT_TAG_ADDED' !== $pieces[1] && 'CONTACT_TAG_REMOVED' !== $pieces[1] ) {
			return $value;
		}

		$meta_key = $pieces[2];

		$value = Automator()->db->token->get( $meta_key, $replace_args );

		return $value;

	}