Home › Forums › Front End PM PRO › Question about groups messages
Tagged: Groups
- This topic has 7 replies, 2 voices, and was last updated 6 years, 2 months ago by Shamim Hasan.
-
AuthorPosts
-
August 29, 2019 at 1:49 pm #28621Fran AcostaParticipant
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,
FranAugust 29, 2019 at 2:29 pm #28633Shamim HasanKeymasterHow to know which user is teacher or student? are they in different role?
August 29, 2019 at 2:32 pm #28634Fran AcostaParticipantYes, they have got different roles.
August 29, 2019 at 3:12 pm #28636Shamim HasanKeymaster1. 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
teacherwith your teacher user role. After this only teachers will be able to send group message.August 29, 2019 at 5:29 pm #28646Fran AcostaParticipantIn 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 teachersPlease any help.
August 29, 2019 at 10:14 pm #28661Shamim HasanKeymaster1. 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
teacherwith 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/
August 30, 2019 at 4:56 pm #28678Fran AcostaParticipantI´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.August 30, 2019 at 10:45 pm #28697Shamim HasanKeymasterHeading 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.
-
AuthorPosts
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.