• Resolved budzburn

    (@budzburn)


    I would like to disable the welcome email for certain roles. I have two different forms, one form is wholesale role, the other is customer role. The issue is the welcome email has a coupon only for customers that I don’t want to send to wholesale roles. I would like to disable the welcome email for the wholesale role only.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @budzburn

    You can try the following snippets. Add them to your theme/child-theme’s functions.php file or use the Code snippets plugin to run the code:

    add_action( 'um_post_registration_approved_hook', 'um_071621_disable_welcome_email', 1, 2 );
    function um_071621_disable_welcome_email( $user_id, $args ){
        
        um_fetch_user( $user_id );
    
        if( "subscriber" == um_user("role") ) {
            add_filter('um_get_option_filter__welcome_email_on',function( $opt_value ){
               return 0;
            }, 99999);
            UM()->user()->approve();
            remove_action( 'um_post_registration_approved_hook', 'um_post_registration_approved_hook', 10, 2 );
        } 
    

    The above code will disable the Welcome Email notification for subscriber role. You just need to change it with your own role slug to disable the email notification.

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @budzburn

    ..This thread has been inactive for a while so we’re going to go ahead and mark it Resolved..

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. ??

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable Welcome email per roles’ is closed to new replies.