Support » Plugin: Ultimate Member – User Profile, User Registration, Login & Membership Plugin » Disable activation email on manual registration

  • Resolved Jay

    (@jaytfl)


    Hello there,

    I would like to know if there is a hook/filter available to disable the activation email from being sent out while manually adding the user, be it via code or from the admin panel’s user section.

    Thanks,
    Jay.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @jaytfl

    Thanks for contacting our support.

    Could you please tell us which form you manually add users to? Is it on WP-Admin > Users page or via UM Register form?

    Thread Starter Jay

    (@jaytfl)

    It’s Wp-Admin -> Users.

    Thread Starter Jay

    (@jaytfl)

    Any update?

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @jaytfl

    Please try the following code snippet to disable the activation email:

    /**
     * Disable Email notification when adding a user via Admin > Users
     */
    add_action( 'um_post_registration_approved_hook', 'um_061722_post_registration_approved_hook', 9, 2 );
    function um_061722_post_registration_approved_hook( $user_id, $args ){
    
        if( is_admin() ){
            add_filter("um_get_option_filter__welcome_email_on","__return_false");
            add_filter("um_get_option_filter__checkmail_email_on","__return_false");
            
        }
    }

    You can add the code to your theme/child-theme’s functions.php file or use the Code Snippet plugin to run the code.

    Thread Starter Jay

    (@jaytfl)

    Thanks for your response.

    However, the code doesn’t work. It still sends out an email.

    To clarify again, we have enabled the account activation and I am talking about activation email being sent out when adding the user manually through wp-admin panel.

    Thread Starter Jay

    (@jaytfl)

    Hello,

    Any update on this?

    Thread Starter Jay

    (@jaytfl)

    Hello?

    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @jaytfl

    Sorry for the late response.

    Please try the following:

    /**
     * Disable Email notification when adding a user via Admin > Users
     */
    add_action( 'user_register', 'um_061722_post_registration_approved_hook', 1, 2 );
    function um_061722_post_registration_approved_hook( $user_id, $args ){
    
        if( is_admin() ){
            add_filter("um_get_option_filter__welcome_email_on","__return_false");
            add_filter("um_get_option_filter__checkmail_email_on","__return_false");
            
        }
    }
    Thread Starter Jay

    (@jaytfl)

    Hello,

    Thank you for the updated code. It works fine.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.