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?
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.
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.