How do I edit the text in the BuddyPress 'Membership request for group' email notification

I actually would like to have control over all the notification content coming out of Wordpress and BuddyPress, but thought I'd start here.

I have looked over the WPMU 'HTML E-mails for WordPress' plugin and it looks great for branding email, but doesn't appear to give me control over what the email reads.

So currently it reads:

"... Your membership request for the group "testing_only" has been accepted. To view the group please login and visit: http://domain.com/challenge-sign-up/testing_only/ --------------------- To disable these notifications please log in and go to: http://domain.com/members-2/username/settings/notifications/ ..."

Thanks very much for your help.

Will

  • Michael Bissett

    Hey @Will, welcome to the WPMU DEV Community, hope you're doing well this evening! :slight_smile:

    You'd need to utilize the add_filter function in order to change these emails, like what's done in the below article:

    http://jesin.tk/custom-buddypress-activation-email/

    For the group notification emails, you'll want to check out:

    buddypress/bp-groups/bp-groups-notifications.php

    Let me know if I can be of further assistance here please! :slight_smile:

    Kind Regards,
    Michael

    • Will

      Michael,

      Thanks very much for the article and insight.

      After numerous newbie obstacles, I was able to manipulate the new account activation email by adding :

      add_filter( 'bp_core_signup_send_validation_email_subject', 'custom_buddypress_activation_subject', 10, 2 );

      and

      add_filter( 'bp_core_signup_send_validation_email_message', 'custom_buddypress_activation_message', 10, 3 );

      sections to a bp-custom.php file.

      To do the same for the group notifications emails, are you proposing that I edit the bp-groups-notifications.php file directly? or do an add_filter into my bp-custom.php file?

      If the latter, could you provide and example code snippet for "Membership request for Group has been accepted" notification?

      Do you know of any plugins that allow manipulation of this content? I would love to give this control to my client, but don't think it wise that they access these files directly.

      Thanks again for your help.

  • Ash

    Hello @Will

    Please try the following code:

    add_filter( 'groups_notification_membership_request_completed_message', 'groups_notification_membership_request_completed_message_cb', 99, 4 );
    function groups_notification_membership_request_completed_message_cb( $message, $group, $group_link, $settings_link ){
    	$message = ''; // Then change the $message here with your custom text
    	return $message;
    }

    You can add those codes in your functions.php in the theme, if you think your theme won’t be changed. Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'. If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that, give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins, so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.