Embed Snippet on Your Site
MemberPress: Send “Profile Updated” Admin Notification When MemberPress Account Is Updated
Similar to the code snippet here: https://library.wpcode.com/snippet/m5ye1wj2/, this code sends a notification to the admin when a user modifies information on their MemberPress Account page.
In the example code, the following lines were used to retrieve specific user data and create the arguments to display that data:
$user_name = $user_info->display_name;
$user_email = $user_info->user_email;
These arguments are added to the message to display retrieved user data in the e-mail body:
$message = "Profile of $user_name , $user_email has been updated!";
Following this logic, you can also add other arguments and update the message you wish to receive.
In addition, the code can be modified to send this notification to any other e-mail. To do this, the code needs to be updated on the following line:
wp_mail( '[email protected]', $subject, $message);
Here, users can add any e-mail address they want instead of [email protected]
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
Comments