Action uncanny-automator-pro

automator_bwfan_contact_removed_from_list

Fires when a contact is removed from a list within the Autonami integration, providing access to list and contact data.

add_action( 'automator_bwfan_contact_removed_from_list', $callback, 10, 2 );

Description

Fires when a contact is removed from an Autonami list. Developers can use this hook to perform custom actions, such as logging the removal or triggering other automations. The hook passes the removed list IDs and the contact object.


Usage

add_action( 'automator_bwfan_contact_removed_from_list', 'your_function_name', 10, 2 );

Parameters

$lists (mixed)
This parameter contains information about the lists from which the contact was removed.
$bwfcrm_contact_object (mixed)
This parameter contains information about the contact lists from which the contact was removed.

Examples

<?php
/**
 * Example of how to hook into the 'automator_bwfan_contact_removed_from_list' action.
 * This function will be executed whenever a contact is removed from a list within the
 * specified system (likely BuddyBoss Fan or a similar integration).
 *
 * We'll simulate logging the event for demonstration purposes.
 */
function my_automator_handle_contact_removed_from_list( $list_id, $contact_object ) {
    // In a real scenario, $contact_object might be a user ID, an email address,
    // or a more complex object representing the contact.
    // $list_id would be the identifier of the list the contact was removed from.

    // Example: Log the event to the WordPress debug log.
    if ( WP_DEBUG === true ) {
        $contact_identifier = is_numeric( $contact_object ) ? 'User ID: ' . $contact_object : 'Contact: ' . print_r( $contact_object, true );
        error_log( sprintf(
            'Automator: Contact removed from list. List ID: %s. %s',
            $list_id,
            $contact_identifier
        ) );
    }

    // You could also trigger other actions here, such as:
    // - Updating custom meta data for the user/contact.
    // - Sending an internal notification.
    // - Triggering another automation workflow within WordPress.
    // For example, if you had a custom function to update user roles:
    // if ( function_exists( 'my_custom_update_user_role' ) ) {
    //     my_custom_update_user_role( $contact_object, 'removed_from_list_role' );
    // }
}

// Hook into the action.
// The 'automator_bwfan_contact_removed_from_list' hook passes two arguments:
// 1. $lists (which is processed into a single $list_id in the source code)
// 2. $bwfcrm_contact_object
// We set the accepted arguments to 2.
add_action( 'automator_bwfan_contact_removed_from_list', 'my_automator_handle_contact_removed_from_list', 10, 2 );
?>

Placement

This code should be placed in the functions.php file of your active theme, a custom plugin, or using a code snippets plugin.


Source Code

uncanny-automator-pro/src/integrations/autonami/add-autonami-integration.php:48
uncanny-automator-pro/src/integrations/autonami/add-autonami-integration.php:53

public function contact_removed_from_lists( $lists, $bwfcrm_contact_object ) {

		if ( ! is_array( $lists ) ) {
			do_action( 'automator_bwfan_contact_removed_from_list', $lists, $bwfcrm_contact_object );
			return;
		}

		foreach ( $lists as $list ) {
			do_action( 'automator_bwfan_contact_removed_from_list', $list, $bwfcrm_contact_object );
		}

	}


Internal Usage

Found in uncanny-automator-pro/src/integrations/autonami/triggers/autonami-user-removed-from-list.php:47:

$this->add_action( 'automator_bwfan_contact_removed_from_list' );

Found in uncanny-automator-pro/src/integrations/autonami/triggers/autonami-contact-removed-from-list.php:48:

$this->add_action( 'automator_bwfan_contact_removed_from_list' );
Scroll to Top