Question about groups messages


Home Forums Front End PM PRO Question about groups messages

This topic is: Not Resolved

Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #28621
    Fran Acosta
    Participant

    Hello to all. I am trying to manage this plugin into a website of a school. The idea is that Teachers users can send messages to groups of students, but that students can´t send messages to students or groups, only to the teachers.
    Any idea about how I can do that, please?
    Many thanks,
    Fran

    #28633
    Shamim Hasan
    Keymaster

    How to know which user is teacher or student? are they in different role?

    #28634
    Fran Acosta
    Participant

    Yes, they have got different roles.

    #28636
    Shamim Hasan
    Keymaster

    1. Please go to Front End PM PRO > Settings > Security > Role to Role Block > Add New and set “From Role” as student role, “To Role” and teacher role and “Block For” as “New Message”. Then save changes. After this settings students will not be able to send message to teacher.

    2. Add following code in your theme’s (child theme’s if you are using) functions.php.

    add_filter( 'fep_get_option', function( $value, $option ){
        if( 'can-send-to-group' == $option ){
            if( in_array( 'teacher', wp_get_current_user()->roles ) ){
                $value = true;
            } else {
                $value = false;
            }
        }
        return $value;
    }, 10, 2 );
    

    Change teacher with your teacher user role. After this only teachers will be able to send group message.

    #28646
    Fran Acosta
    Participant

    In the first step, I don´t want to block students to send messages to teachers, Students only should be able to send to Teachers and Admin (Office)
    So the options I need are the following:
    – Students can send messages only to Admin (office) and Teachers, but not to groups (that will be the different groups of students)
    – Teachers can send messages to any individual account (teachers and students) and to the groups (to be able to send the same message to all of them)
    – Admin (office) can send messages same as teachers

    Please any help.

    #28661
    Shamim Hasan
    Keymaster

    1. Set “To Role” also as student role. Others are same as above. That way students will not be able to send message to other students. For more instruction about this please see https://www.shamimsplugins.com/docs/front-end-pm-pro/getting-started-2/role-to-role-block/

    2. Add following code in your theme’s (child theme’s if you are using) functions.php.

    add_filter( 'fep_get_option', function( $value, $option ){
        if( 'can-send-to-group' == $option ){
            if( array_intersect( [ 'administrator', 'teacher' ], wp_get_current_user()->roles ) ){
                $value = true;
            } else {
                $value = false;
            }
        }
        return $value;
    }, 10, 2 );
    

    Change teacher with your teacher user role. After this administrators and teachers will be able to send group message. students will not be able to send group message.

    3. For only admin setup please see https://www.shamimsplugins.com/docs/front-end-pm-pro/getting-started-2/only-admin/

    #28678
    Fran Acosta
    Participant

    I´m sorry but when I go to Recipient section, I cannot see Only Admin section.
    I made the configuration that you sent but it still the same.

    #28697
    Shamim Hasan
    Keymaster

    Heading is “FEP Admins”.

    After this changes

    1. Can student send group message?
    2. Can student send message to other student?
    3. Can’t admin and teacher send group message?
    4. If you set admins can’t student send message to those admins?

    Please let me know which part is not working so that i can investigate further.

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

You need to purchase ‘Front End PM PRO’ to create topic in this support forum.

If you already purchased ‘Front End PM PRO’ please LOGIN.