Hello @protport4991
Are you receiving other emails from your website on the same email address?
Yes, I get letters – https://prnt.sc/OOFx69byzTfm (delete, awaiting)
But I(administrator) don’t get when – Rejected, Approved
Hi, @aswingiri
Please answer my question
Hello @protport4991
Administrator do not receive email when user is approved or rejected. Please check this screenshot.
On the above screenshot, the emails that say “members” are sent to users, and the ones with the email address are sent to the admin email.
@aswingiri I see that they are not sent, I ask why and how to make emails sent administrator?
Maybe there is a add_filter that allows you to do this?
Hello @protport4991
There is no built-in way to send these emails to admin but you can try adding following codes:
add_action( 'um_after_user_status_is_changed', function( $status, $user_id ){
$emails = um_multi_admin_email();
if ( ! empty( $emails ) ) {
if( 'rejected' == $status ){
foreach ( $emails as $email ) {
UM()->mail()->send( $email, 'rejected_email', array( 'admin' => true ) );
}
}
if( 'approved' == $status ){
foreach ( $emails as $email ) {
UM()->mail()->send( $email, 'approved_email', array( 'admin' => true ) );
}
}
}
} );
@aswingiri thanks you, it’s worked!
P.S
function accepts 1 parameter
add_action( 'um_after_user_status_is_changed', function( $status){
Hi @protport4991
Thanks for letting us know how it resolved the issue.