Support » Plugin: BuddyPress Group Email Subscription » [Plugin: BuddyPress Group Email Subscription] SUGGESTION (RESOLVED): Ability to filter activity type

  • Hi Boone,

    Using (a very modified version of) BP Group Documents which is now compatible with BP 1.5.5 and WP 3.3.2, our client wanted to prevent notification emails from being sent when an uploaded document was edited or deleted. The plugin records the activities as ‘edited_group_document’ and ‘deleted_group_document’

    A simple edit to your plugin, inserting the following code at line 254 of bp-activity-subscription-functions.php ….

    // finally, allow plugin and theme developers to prevent an individual activity type from generating an email notification (e.g. BP Group Documents 'edited_group_document' activity type
        if (apply_filters( 'ass_group_notification_prevent_email_for_activity_type', false, $type))

    … allows us to add a simple filter in the client’s theme:

    function ks_group_notification_prevent_email_for_document_edits_and_deletes( $prevent, $type) {
    	if ($type == 'edited_group_document' || $type == 'deleted_group_document' )
    		return true;	// Don't send when edited or deleted
    	return false;
    add_filter('ass_group_notification_prevent_email_for_activity_type', 'ks_group_notification_prevent_email_for_document_edits_and_deletes', 10, 2);

    Would you be able to add this filter hook in your next update, so we can remove the overridden function and revert to using the clean original plugin?

    (We’ve temporarily implemented safely using remove_action and add_action with an edited local copy of the function in question, but would like to benefit from any future updates to the original plugin of course)

    Kind regards


Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Boone Gorges


    Thanks for the suggestion, Chris. I’m going to include this as soon as I can:

    Hi Boone,

    You’re welcome. And that’s great news. Thanks also for the link to the github repository, much appreciated.

    Kind regards


    I’m not exactly sure what all the above means, but I have a question similar to this. I installed the latest update to the plugin, which I don’t see any difference, except, in my notification settings I think it adds radials for two document upload questions:

    • A member uploads a document to a group you belong to
    • A member uploads a document to a group for which you are an moderator/admin

    Both of the selections for both questions are empty, when I select the radial I want and submit, they both return to empty. However, I do believe that the setting does stick when you submit even though the radial does not show.

    When I upload a document, I get two emails. One from this plugin and another one from the Group documents plugin. I know how to turn off the Group Documents email, but there are some issues with doing that described below.

    If the person selects “New Topics” as their group email options, they do not receive an email from a document upload, nor from someone updating their activity. It does work for new forum topics. I would assume the “New Topics” would be exactly like “All Mail” except you would not receive emails from replies to activity stream and forum discussions. It works perfectly for “All Mail”. I have not tested the Daily and Weekly options yet.

    @chriskeeble Chris, could you confirm where in bp-activity-subscription-functions.php (after what other code) the first snippet of code you posted should be included, as there has been an update to the Group Email Subscription plugin since you posted this and I suspect that ‘line 254’ no longer applies.



Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: BuddyPress Group Email Subscription] SUGGESTION (RESOLVED): Ability to filter activity type’ is closed to new replies.