Finally, I solved it:
/**
* Modify the message sent to a user after being approved.
*
* @param $message The default message.
* @param $user The user who will receive the message.
* @return string the updated message.
*/
function my_custom_approve_user_message( $message, $user ) {
// send email to user telling of approval
$user_login = stripslashes( $user->data->user_login );
$user_email = stripslashes( $user->data->user_email );
include('mails/email-registro-aprobado.php');
$message = nua_do_email_tags( $message, array(
'context' => 'approve_user',
'user' => $user,
'user_login' => $user_login,
'user_email' => $user_email,
) );
return $message;
}
add_filter( 'new_user_approve_approve_user_message', 'my_custom_approve_user_message', 10, 2 );
// add a new custom approval message
function my_custom_request_appproval_message( $message, $user_login, $user_email = '' ) {
$default_admin_url = admin_url( 'users.php?s&pw-status-query-submit=Filter&new_user_approve_filter=pending&paged=1' );
$admin_url = apply_filters( 'new_user_approve_admin_link', $default_admin_url );
$user = get_user_by('login', $user_login);
include('mails/email-aprobacion.php');
$message = nua_do_email_tags( $message, array(
'context' => 'request_admin_approval_email',
'user_login' => $user_login,
'user_email' => $user->user_email,
'admin_url' => $admin_url,
) );
return $message;
}
add_filter( 'new_user_approve_request_approval_message', 'my_custom_request_appproval_message', 10, 2 );
//quitar mensaje en /wp-login.php
function my_custom_approve_register_instructions() {
return '';
}
add_filter( 'new_user_approve_welcome_message_default', 'my_custom_approve_register_instructions', 10, 2);
// remove denial message
remove_action( 'new_user_approve_deny_user', array( pw_new_user_approve(), 'deny_user' ) );
function wploop_email_content_type() {
return 'text/html';
}
add_filter( 'wp_mail_content_type', 'wploop_email_content_type' );
And the includes have de markups:
{username}, {reset_password_url}, {admin_approve_url}, {user_email}
[ link redacted ]
-
This reply was modified 6 years, 9 months ago by suvires.
-
This reply was modified 6 years, 9 months ago by Jan Dembowski.