aless.napoletani

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Turn off email notifications #42625
    aless.napoletani
    Participant

    Thank you – that’s worked perfectly.

    in reply to: Turn off email notifications #42613
    aless.napoletani
    Participant

    Hi Shamim,

    I’ve added that function, I had to amend it as I only want users within a particular role to receive email notifications:

    // Allow Frontend PM Admin (frontend_pm_admin) to receive email notifications from Front End PM PRO
    add_filter('fep_get_user_option', function( $value, $option, $default, $userid, $is_default ){
        if( 'allow_emails' !== $option ){
            return $value;
        }
        $user = wp_get_current_user();
    	if ( in_array( 'frontend_pm_admin', (array) $user->roles ) ) {
            $value = true;
        } else {
            $value = false;
        }
        return $value;
    }, 10, 5);
    

    But now, it only sends if BOTH the users are in this ‘frontend_pm_admin’ role. If the user sending the message is a normal user, then the notification doesn’t happen. It only happens if BOTH users are in the ‘frontend_pm_admin’ role.

    Is there a way to only allow notifications for this ‘frontend_pm_admin’ role please?

    in reply to: Turn off email notifications #42045
    aless.napoletani
    Participant

    Thank you – that has worked.

    Is there a way to enable email notifications for certain roles?

Viewing 3 posts - 1 through 3 (of 3 total)