Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to send email notification of a new activity post

  • @aburub

    Participant

    Thanks for such a great plugin. Essentially, i’m newb who just started a buddypress rich site using commons in a box (based on cuny commons). The wordpress version is 3.9.2, and buddypress version is 2.0.

    My question is whether I can use a custom function to send ’email notifications’ to the admin when a sitewide activity has been posted. I’ve been looking around forums for the past two days, but can’t get this to work, probably because of my lack of any php experience.

    So far, what I came up with is a function that is meant to ‘wp_email’ whenever an ‘acitivity_update’ has been posted.

    Please check the code. Any help is greatly appreciated.

    function bp_plugin_hook_activity_add( $args ) {

    // sends an email to admin to inform him of a new activity
    if( $args['type'] == 'activity_update' )
    wp_mail( get_option( 'admin_email' ), 'New post!', $args['action'], 'Content-Type: text/html' );

    }
    add_action( 'bp_activity_post_update', 'bp_plugin_hook_activity_add', 10, 1 );

    Thanks again for all the great work that is buddypress

    aburub

Viewing 1 replies (of 1 total)
  • @nexus66

    Participant

    Hey thanks a lot, this feature is really helpfull ,
    thanx for the share 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘How to send email notification of a new activity post’ is closed to new replies.
Skip to toolbar