mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- added functionality for user more than 1 admin email in email notifications settings;
This commit is contained in:
@@ -1306,8 +1306,14 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
|
||||
// send email notifications
|
||||
if ( $send_mail ) {
|
||||
UM()->mail()->send( um_user('user_email'), 'deletion_email' );
|
||||
UM()->mail()->send( um_admin_email(), 'notification_deletion', array('admin' => true ) );
|
||||
UM()->mail()->send( um_user( 'user_email' ), 'deletion_email' );
|
||||
|
||||
$emails = um_multi_admin_email();
|
||||
if ( ! empty( $emails ) ) {
|
||||
foreach ( $emails as $email ) {
|
||||
UM()->mail()->send( $email, 'notification_deletion', array( 'admin' => true ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove uploads
|
||||
@@ -1316,7 +1322,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
// remove user
|
||||
if ( is_multisite() ) {
|
||||
|
||||
if ( !function_exists('wpmu_delete_user') ) {
|
||||
if ( ! function_exists( 'wpmu_delete_user' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/ms.php' );
|
||||
}
|
||||
|
||||
@@ -1324,7 +1330,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
|
||||
} else {
|
||||
|
||||
if ( !function_exists('wp_delete_user') ) {
|
||||
if ( ! function_exists( 'wp_delete_user' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/user.php' );
|
||||
}
|
||||
|
||||
|
||||
@@ -115,10 +115,15 @@ add_action( 'um_user_register', 'um_after_insert_user', 10, 2 );
|
||||
function um_send_registration_notification( $user_id, $args ) {
|
||||
um_fetch_user( $user_id );
|
||||
|
||||
if ( um_user( 'status' ) != 'pending' ) {
|
||||
UM()->mail()->send( um_admin_email(), 'notification_new_user', array( 'admin' => true ) );
|
||||
} else {
|
||||
UM()->mail()->send( um_admin_email(), 'notification_review', array( 'admin' => true ) );
|
||||
$emails = um_multi_admin_email();
|
||||
if ( ! empty( $emails ) ) {
|
||||
foreach ( $emails as $email ) {
|
||||
if ( um_user( 'status' ) != 'pending' ) {
|
||||
UM()->mail()->send( $email, 'notification_new_user', array( 'admin' => true ) );
|
||||
} else {
|
||||
UM()->mail()->send( $email, 'notification_review', array( 'admin' => true ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
add_action( 'um_registration_complete', 'um_send_registration_notification', 10, 2 );
|
||||
|
||||
@@ -1404,6 +1404,23 @@ function um_admin_email() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get admin e-mails
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function um_multi_admin_email() {
|
||||
$emails = UM()->options()->get( 'admin_email' );
|
||||
|
||||
$emails_array = explode( ',', $emails );
|
||||
if ( ! empty( $emails_array ) ) {
|
||||
$emails_array = array_map( 'trim', $emails_array );
|
||||
}
|
||||
|
||||
return $emails_array;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Display a link to profile page
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user