Skip to:

Opened 12 years ago

Closed 12 years ago

#2397 closed enhancement (fixed)

Add a do_action in bp_activity_at_message_notification()

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: 1.5 Priority: normal
Severity: Version:
Component: Activity Keywords:


I would like to propose the following do_action after line 8 in bp-activity-notifications.php:

do_action( 'activity_before_notify', $content, $poster_user_id, $usernames );

This will help plugin writers to manipulate what happens when someone attempts to send an @mention.

Possible use cases include checking friendship status, blocking @mention emails, limiting @mentions per activity update, creating an ignore @mentions list, etc.

Thanks to jessica120 for spamming and inspiring this ticket! ;)

Listing as a defect so it'll be seen, but feel free to drop it down to an enhancement.

Change History (4)

#1 @johnjamesjacoby
12 years ago

  • Milestone changed from 1.3 to 1.2.5

#2 @johnjamesjacoby
12 years ago

  • Milestone changed from 1.2.5 to 1.3
  • Type changed from defect to enhancement

Sorry r-a-y, pushing to 1.3 as an enhancement. A do_action there doesn't directly manipulate any of that data, and I'm not sure that filtering all of those values before hand makes sense either.

This probably needs further review along with the rest of the notifications, since it would make sense to try and make some global changes where possible.

#3 @r-a-y
12 years ago

Hey JJJ, you're right. I meant to write apply_filters, instead of do_action.

$usernames = apply_filters( 'activity_username_notification', $usernames, $poster_user_id );

Gotcha about filtering though.

#4 @boonebgorges
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3362]) Adds do_action hooks after notification emails are sent throughout BuddyPress. Fixes #2397. Props r-a-y and jessica120 for prodding

Note: See TracTickets for help on using tickets.