Skip to:
Content
Pages
Categories
Search
Top
Bottom

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

  • @katyaofoctober

    Participant

    The person whose role is currently “Editor”, is responsible for checking on the new groups created. Is it possible for my editor to receive an email once a group has been created, similar to getting emails of new users?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @katyaofoctober

    Participant

    Anyone?

    @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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can editor receive an email notification of a newly created group?’ is closed to new replies.
Skip to toolbar