There’s a wp_mail
filter you might be able to use:
add_filter( 'wp_mail', 'wpse362824_filter_message' );
function wpse362824_filter_message( $args ) {
// The $expected_subject is taken from the wp_mail() call
// in user-new.php.
$expected_subject = sprintf(
__( '[%s] Joining confirmation' ),
wp_specialchars_decode( get_option( 'blogname' ) )
);
// If the Subject: line matches the one from user-new.php,
// do the substitution.
if ( $expected_subject === $args['subject'] ) {
$args['message'] = 'Your message goes here';
}
return $args;
}