Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to get the activity link / ID.


  • comscieme
    Participant

    @comscieme

    Hi guys,

    Here’s my issue, i created a function in functions.php with the hook that send an email once a new activity is posted. What i want is inside the email will have a link to the new created activity (e.g. /activity/post-id).

    function bp_plugin_hook_activity_add( $args ) {
        if( $args['type'] == 'activity_update'):
    		$headers = 'From: info@domain.com' . "\r\n" . 'Content-Type: text/html';
    		$msg = '<a href="">View the post</a>';
    		mail('admin@domain.com', 'New Activity Update', $msg, $headers );	
    	endif;
    }
     
    add_action( 'bp_activity_add', 'bp_plugin_hook_activity_add', 10, 1 );

    Any suggestion?

    Thanks

  • You must be logged in to reply to this topic.
Skip to toolbar