Updated registration email hooks to use maybe scheduler

This commit is contained in:
Yurii Nalivaiko
2024-09-11 14:27:46 +02:00
parent ef67a2ce76
commit 172541fce4
+2 -2
View File
@@ -127,9 +127,9 @@ function um_send_registration_notification( $user_id ) {
if ( ! empty( $emails ) ) {
foreach ( $emails as $email ) {
if ( 'pending' !== um_user( 'account_status' ) ) {
UM()->mail()->send( $email, 'notification_new_user', array( 'admin' => true ) );
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_mas_send_email', array( $email, 'notification_new_user', array( 'admin' => true ) ) );
} else {
UM()->mail()->send( $email, 'notification_review', array( 'admin' => true ) );
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_mas_send_email', array( $email, 'notification_review', array( 'admin' => true ) ) );
}
}
}