I have a feature on my BuddyPress groups when I send out custom notifications to all members when a group activity is posted as an announcement. There is a possibility that something could go wrong of course and so I want to be able to add an error message to the activity if the notification fails to send.
Since my notification is hooked to the
bp_activity_after_save action the update will already be posted so I still want the post to appear on the activity feed but just make the user aware that the notifications were not sent for a given reason.
add_action( 'bp_activity_after_save', array( $this, 'send_team_notification'), 10, 1 );
I've tried to look for a filter or something I could use to modify the content of the activity before it was posted but unfortunately I couldn't find anything of use so far.