Skip to:
Content
Pages
Categories
Search
Top
Bottom

groups_notification_new_membership_request_subject customization


  • paragbhagwat
    Participant

    @paragbhagwat

    Hello All,

    I tried searching through this forums but did not find a way. I basically want to customize the emial that is sent when a new memebership requests. When i look at the plugin code i see that there is a line

    $message = apply_filters_ref_array( ‘groups_notification_new_membership_request_message’, array( $message, &$group, $requesting_user_name, $profile_link, $group_requests, $settings_link ) );

    is there any way i can change the $message for my site? Mine is a single site and not a multi site installation. If i can where do i write the filter in theme’s function.php???

    Thanks a lot.

    Thanks
    Parag

Viewing 6 replies - 1 through 6 (of 6 total)

  • Henry Wright
    Moderator

    @henrywright

    Try something like this:

    function paragbhagwat_message_filter( $message, $group, $requesting_user_name, $profile_link, $group_requests, $settings_link ) {
        // Do something with $message here.
        return $message;
    }
    add_filter( 'groups_notification_new_membership_request_message', 'paragbhagwat_message_filter', 10, 6 )

    paragbhagwat
    Participant

    @paragbhagwat

    Thanks Henry that worked but it looks like the message sent by the user when he request the message is lost is that correct? The variables in the function does not have that. For example the original message has
    ————————————————–
    testuser7 wants to join the group “abcd”.

    Message from testuser7: “ok grant me membership”
    ———————————————————

    I have variables for user and group but i cannot get handle to “ok grant me membership” in that hook. Is there a way to do that?

    Thanks,
    Parag


    Henry Wright
    Moderator

    @henrywright

    That’s because you have to build the message back up. You can do that because all of the variables you might need are passed to your custom function.


    paragbhagwat
    Participant

    @paragbhagwat

    Hello Henry,

    I understand that completely my concern is that the comments that the user enters when requesting membership for a group is not there in the parameters. Am i misunderstanding anything?

    Thanks,
    Parag


    Henry Wright
    Moderator

    @henrywright

    @paragbhagwat You could always submit a request on Trac to ask that the extra argument(s) you need be passed.

    Ref: https://buddypress.trac.wordpress.org/

    The username and password you use here in the forums will work there too.


    paragbhagwat
    Participant

    @paragbhagwat

    Thanks Henry. I will go ahead and do that.

    Thanks,
    Parag

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘groups_notification_new_membership_request_subject customization’ is closed to new replies.
Skip to toolbar