Hello @hussein87
You can use the following code snippets to add Bulk Action option
add_filter( 'um_admin_bulk_user_actions_hook', function( $actions ){
$actions['custom_action_key'] = array( 'label' => 'Custom Action Name' );
return $actions;
});
add_action( "um_admin_custom_hook_custom_action_key", function( $user_id){
//update_user_meta( $user_id,'custom_bulk_action','jdklasjfsl');
// process bulk action
});
The above code is just an example and you will have to make the modifications as per your requirement.
Hi @aswingiri
Thank you so much for your quick answer and for providing the code snippets.
The action has been added to the UM action options list.
However, because of my weak PHP skills, I’m not able to replace custom_action_key and link the UM welcome_email template to the added action.
What else should I update?
I understand custom code is not supported, but I really appreciate your help!
Hi @hussein87
You can try the following code snippet:
add_filter( 'um_admin_bulk_user_actions_hook', function( $actions ){
$actions['custom_action_key'] = array( 'label' => 'Custom Action Name' );
return $actions;
});
add_action( "um_admin_custom_hook_custom_action_key", function( $user_id){
um_fetch_user( $user_id );
UM()->mail()->send( um_user( 'user_email' ), 'approved_email' );
});
Hi, that works perfectly, I just changed ‘approved_email’ > ‘welcome_email’ as i wanted to resend that template.
Thank you so much guys for the fast replays and amazing support.
Thanks for letting us know.