# MemberPress: Email the Admin About New Members

> Sends you a short email with the member's name, email and membership as soon as someone completes a MemberPress sign-up.

- Type: PHP
- Runs: Run everywhere
- Category: [Memberships](https://wpide.com/library/category/memberships/)
- Requires: MemberPress
- Tags: memberpress, email, notifications
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/memberpress-notify-admin-new-member/

## Code

```php
if ( ! class_exists( 'MeprUser' ) ) {
    return;
}

add_action( 'mepr-event-transaction-completed', function ( $event ) {
    $txn  = $event->get_data();
    $user = get_userdata( (int) $txn->user_id );

    // Only first purchases of a membership, not renewals.
    if ( ! $user || get_user_meta( $user->ID, 'wpide_mepr_notified_' . (int) $txn->product_id, true ) ) {
        return;
    }

    update_user_meta( $user->ID, 'wpide_mepr_notified_' . (int) $txn->product_id, time() );

    wp_mail(
        get_option( 'admin_email' ),
        sprintf( 'New member: %s joined %s', $user->display_name, get_the_title( (int) $txn->product_id ) ),
        sprintf( "Name: %s\nEmail: %s\nMembership: %s\nProfile: %s", $user->display_name, $user->user_email, get_the_title( (int) $txn->product_id ), admin_url( 'user-edit.php?user_id=' . $user->ID ) )
    );
} );
```

## Notes

Complements MemberPress's own admin emails with a plain summary you can forward or filter.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "MemberPress: Email the Admin About New Members" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
