Shamim Hasan

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 2,479 total)
  • Author
    Posts
  • in reply to: How to Restrict Messaging to Connected Users #46006
    Shamim Hasan
    Keymaster

    You can add 2 approaches
    Suppose current user id is 2 (you can get that using get_current_user_id()) and connected users of this user in 2,3 and 4 (get that from your member plugin or using query)

    Approach 1. You show only connected users in auto suggestion and in directory.

    add_filter( 'fep_filter_rest_users_args', function( $args, $for, $q, $x ) {
    	$args['meta_query'] = [
                'include' => [2,3,4], //Get ids from member plugin
            ];
    	return $args;
    }, 10, 4 );
    

    Approach 2. restrict user from sending message to only connected users

    add_filter( 'fep_current_user_can', function( $can, $cap, $id ){
        if ( 'send_new_message_to' != $cap || ! $can ) {
    	return $can;
        }
        //Get ids from member plugin
        if( in_array($id, [2,3,4] ) ){
            return true;
        }
        return false;
    }, 10, 3);
    
    in reply to: Styling the Messages Box #46005
    Shamim Hasan
    Keymaster

    Did you try to add your css code in Dashboard > Front End PM PRO > Settings > Appearance > Custom CSS?

    in reply to: my website is not recognizing my license #46001
    Shamim Hasan
    Keymaster

    I see somehow PREFIX_fep_messages table is missing. I need administrator access to your website. You can provide me in https://www.shamimsplugins.com/sensitive-information/ or join https://meet.google.com/vuv-bawq-sxj at 4:00 PM (UTC) time (20 minutes from now).

    in reply to: my website is not recognizing my license #45995
    Shamim Hasan
    Keymaster

    Can you recheck if PREFIX_fep_messages table exists? (I do not see that in your screenshot).
    Can you give me access to your website or have a meeting with me so that we can debug?

    in reply to: my website is not recognizing my license #45990
    Shamim Hasan
    Keymaster

    You were too much behind, recommended to update regularly.
    Please let me know follwoing
    1. Does your DB user have permission to ALTER the DB tables?
    2. Can you check in DB if PREFIX_fep_messages, PREFIX_fep_messagemeta and PREFIX_fep_participants tables exists?

    in reply to: my website is not recognizing my license #45987
    Shamim Hasan
    Keymaster

    Which version of the plugin you are using? Can you update the plugin to latest version?
    If you cannot auto update the plugin you can download latest version from https://www.shamimsplugins.com/account/ and update it.

    in reply to: my website is not recognizing my license #45983
    Shamim Hasan
    Keymaster

    Can you check in https://www.shamimsplugins.com/account/ that your website is listed correctly under your license?
    If not you can deactivate license and activate again.

    Let me know

    in reply to: Getting Message ID in fep_filter_before_email_send #45978
    Shamim Hasan
    Keymaster

    You can use fep_query_url( 'viewmessage', array( 'fep_id' => fep_get_message_field( 'mgs_parent', $message_id ) ?: $message_id ) )

    in reply to: Adding tinymce to the fep_shortcode_new_message_form #45972
    Shamim Hasan
    Keymaster

    You can use following code

    add_filter( 'fep_form_fields', function( $fields ) {
        $fields['message_content']['type'] = 'wp_editor';
        return $fields;
    });
    
    in reply to: Missing settings #45970
    Shamim Hasan
    Keymaster

    Is your website in testing stage? If yes, can you deactivate all other plugins and change theme to default theme then try again? If it shows then activate other plugins one by one and see when it start removing that menu.

    Only PRO version needs to be installed.

    Let me know.

    in reply to: Announcement does not send #45969
    Shamim Hasan
    Keymaster

    Please go to Dashboard > Front End PM PRO > Settings > Emails > Email Sending Interval and change to any other value and save changes. Wait selected amount of time and check again.
    Let me know.

    in reply to: Missing settings #45965
    Shamim Hasan
    Keymaster

    Can you please uninstall and download from https://www.shamimsplugins.com/account/ and install again?
    Let me know.

    in reply to: Set one emaik To: section for non admins. #45962
    Shamim Hasan
    Keymaster

    For groups, all users need to be added to that group. And they may see other users message which is not sent to them.
    Better add other users to that conversation so that they can see only that conversation.

    Eg. You can add following code in your theme’s (child theme’s if any) functions.php, change $your_extra_user_ids values

    add_filter('fep_filter_message_before_send', function( $message ){
        $your_extra_user_ids = array( 1,2,3 );
    
        //Only for parent message
        if( empty( $message['fep_parent_id'] ) ){
            if( ! is_array( $message['message_to_id'] ) ){
                $message['message_to_id'] = array( $message['message_to_id'] );
            }
            $message['message_to_id'] = array_merge( $message['message_to_id'], $your_extra_user_ids );
        }
        return $message;
    });
    
    in reply to: Limit Admins to specific roles #45960
    Shamim Hasan
    Keymaster

    As i understand you want only doctor’s self patients will be shown to that doctor. Eg. your doctors roles are A, B and C. And patients of doctor A’s are patients_of_A. So your filter will look like

    
    add_filter( 'fep_filter_rest_users_args', function( $args ){
        if ( in_array( 'A', wp_get_current_user()->roles )  ) {
            $args['role'] = 'patients_of_A';
        }
        return $args;
    });
    

    As i understand you do not need to filter messages.

    in reply to: Set one emaik To: section for non admins. #45959
    Shamim Hasan
    Keymaster
Viewing 15 posts - 1 through 15 (of 2,479 total)