Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: How can editor receive an email notification of a newly created group?

@omgbud

Participant

Hi,

this is a code I use personally, but requires you to edit the bp-groups-actions.php, sorry i do not know how to write function.

open buddypress/bp-groups/bp-groups-actions.php

around line 150

After this line:
`do_action( ‘groups_group_create_complete’, $bp->groups->new_group_id );`

Add this code:
` $to = “YOUREMAILADDRESS”;
$name= bp_core_get_username(bp_loggedin_user_id());
$groupname = bp_get_new_group_name(bp_get_new_group_id());
$groupurl = bp_get_group_permalink( $bp->groups->current_group );
$subject = “$name created new group $groupname”;
$body = “$name created new group $groupname, visit $groupurl”;
mail($to, $subject, $body);
`

That’s it, when a user hit the Finish create group button this code will send to the email stated address with the newly created group link. use at your own risk. Hope someone better can create a theme function or a plugin for this.

This is needed to keep track of newly created groups to alert you if spammers are creating groups to spam.

Hope it helps.

Skip to toolbar