sending message to another group add the user to all groups in the settings


Home Forums Front End PM PRO sending message to another group add the user to all groups in the settings

This topic is: Not Resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #26216
    Olivier Pages
    Participant

    Hello Shamim

    I need users to be able to send messages to people who are not in his group (ex: a user in Paris send a message to users who are in London). Searching the forum in order to achieve this I saw this topic posted 7 months ago:

    https://www.shamimsplugins.com/support/topic/send-message-to-group-not-member-of-that-group/#post-19329

    in which you ask us to add following code in our functions.php file:

    add_filter( 'fep_get_user_groups', function( $user_groups, $user_id ){
        $groups = fep_get_option('gm_groups', array());
        if( $groups && is_array( $groups) ){
            foreach ( $groups as $group ) {
                $user_groups[ $group['slug'] ] = $group['name'];
            }
        }
        return $user_groups;
    }, 10, 2);
    

    It is working (meaning the user can send a message to another group), but as a result, once the message is sent, the user is now part of all existing groups. He has to uncheck all group boxes in its settings tab.

    Is there a way to fix this? How come the user has joined all groups after sending a message to one?

    Thanks for your help

    Olivier

    [MODERATOR]- add code between backticks

    #26230
    Shamim Hasan
    Keymaster

    After sending message if you go to Dashboard > Front End PM PRO > Settings > Recipient > Groups, do that user shows in the groups which they were not member before?

    #26233
    Olivier Pages
    Participant

    Hi Shamim

    Yes the user shows in every groups (I created 10 groups for my tests).

    What I did in order is the following:

    In my dashboard, Recipient tab, I allowed users to add themselves to groups.
    Then on the front-end I logged in as a test user, and I could see all groups in the Parameters tab that I had created in the back-end. Fine.
    I sent a message to a group. Successfully sent. Back to his Parameter tab, all groups were checked. Meaning the user has joined all groups. So I went to the back-end and could see its username in every group…

    I deleted the user in every group from the Dashboard, recipient tab. Then I unchecked ‘Can users add themselves to group’.
    Second message sent from the front-end to a group. This time the user is not part of any group (in the dashboard).
    So it has something to do with that option allowing users to add themselves to groups.

    I will keep this option unchecked and try to assign the user to a group in a different way.

    Olivier

Viewing 3 posts - 1 through 3 (of 3 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.