Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How to send email notification to buddypress users when a new post is posted in the activity stream

@rogercoathup

Participant

Do you mean, you want to send an email to everyone when a new (blog) post is posted, or when any kind of item is posted to the activity stream?

For the first you can hook a function on to the WordPress ‘save_post’ action. In that function, you can iterate over every member (see https://codex.buddypress.org/developer-docs/custom-buddypress-loops/the-members-loop/ for guidance), and for each member you use the BP messaging API ( messages_send_message() ) to send them an email.

For the second – you can’t seriously want to email everyone, any time anything is posted to the activity stream: the system and your users would be swamped – However, if you still do, check out some of the action hooks that are called when activity items are saved: https://codex.buddypress.org/developer-docs/action-reference/activity-streams/

Skip to toolbar