Subscribe users to forum at registration

Support 3 replies 0 votes 85 views

I want to subscribe users to a specific forum when they finished the registration process. Using UM for registration. I found a function  subscribe_forum in wp-content/plugins/forumwp-pro/modules/subscriptions/class-init.php (line 184) but I am wondering how to call this function from a UM registration hook um_user_register. Something like this:

add_action( 'um_user_register', 'my_user_register', 10, 2 );
function my_user_register( $user_id, $args ) {
    FMWP_Pro()->subscribe_forum($user_id, 55841);

Many thanks for some