Fluent_Crm_Helpers::get_subscriber_user_id( $subscriber )


Parameters Parameters

$subscriber

(Required)


Top ↑

Return Return

(int)


Source Source

File: src/integrations/fluent-crm/helpers/fluent-crm-helpers.php

							0 === $trigger_value || // handle "any" selection
							'0' === $trigger_value // handle "any" selection
						) {
							$matched_recipe_ids[] = (object) array(
								'recipe_id'     => $recipe['ID'],
								'trigger_value' => $trigger_value,
								'matched_value' => $to_match,
							);
							break;
						}
					}
				}
			}
		}

		return $matched_recipe_ids;
	}

	/**
	 * @param $subscriber
	 *
	 * @return int
	 */
	public function get_subscriber_user_id( $subscriber ) {

		/*
		 * The user can either get on a list by an admin
		 * or then can fill out a form with their own email.
		 *
		 * We do not trigger if the logged in user adds an email(to a form)
		 * that is not their own unless they are an admin adding it on behalf
		 * of the user
		 *
		 * If there is no wp user associated with the subscriber, we use the subscriber
		 * email to check if a wp user has the same email.
		 *
		 */

		$user_id = 0;

		// Get the user ID
		if ( absint( $subscriber->user_id ) !== 0 ) {