Merge pull request #1492 from ultimatemember/feature/disable_duplicate_emails

Disable duplicate emails
This commit is contained in:
Mykyta Synelnikov
2024-03-28 15:50:06 +02:00
committed by GitHub
+6 -2
View File
@@ -552,8 +552,12 @@ add_action( 'um_after_user_account_updated', 'um_after_user_account_updated_perm
* @param $changed
*/
function um_account_updated_notification( $user_id, $changed ) {
um_fetch_user( $user_id );
UM()->mail()->send( um_user( 'user_email' ), 'changedaccount_email' );
// phpcs:disable WordPress.Security.NonceVerification
if ( 'password' !== $_POST['_um_account_tab'] || 1 !== absint( UM()->options()->get( 'changedpw_email_on' ) ) ) {
um_fetch_user( $user_id );
UM()->mail()->send( um_user( 'user_email' ), 'changedaccount_email' );
}
// phpcs:enable WordPress.Security.NonceVerification
}
add_action( 'um_after_user_account_updated', 'um_account_updated_notification', 20, 2 );