• Resolved hussein87

    (@hussein87)


    Hi there,

    I need to add a UM Action similar to “Resend Activation Email”, but an option to resend “Account Welcome Email”.

    Any help on how I can do this, thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Aswin Giri

    (@aswingiri)

    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.

    Thread Starter hussein87

    (@hussein87)

    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!

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    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' );
    });
    Thread Starter hussein87

    (@hussein87)

    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.

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Thanks for letting us know.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add an UM Action under Users’ is closed to new replies.