Created
June 2, 2022 13:20
-
-
Save verygoodplugins/8865f873dca846273dccd166bd183f70 to your computer and use it in GitHub Desktop.
Re-susbscribes an unsubscribed contact to the selected list when their profile is updated
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This runs whenever WP Fusion updates an existing contact record. It re-subscribes them to the list ID specified. | |
function re_subscribe_to_list( $args ) { | |
$list_id = 1; // Update this with your list ID. | |
$args[1][ 'p[' . $list_id . ']' ] = $list_id; | |
$args[1][ 'status[' . $list_id . ']' ] = 1; | |
return $args; | |
} | |
add_filter( 'wpf_api_update_contact_args', 're_subscribe_to_list' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment