When adding an existing user to a blog (in the admin panel), a very basic email is sent. I am trying to overide this email so it is a bit more attractive - to at least have a clickable link.
Looking in user-new.php, it doesn't appear to have an apply_filter.
How can I change this email without an apply_filter
The email is
You\'ve been invited to join \'%1$s\' at.
%2$s with the role of %3$s.
Please click the following link to confirm the invite:
%4$s'
When adding an existing user to a blog (in the admin panel), a very basic email is sent. I am trying to overide this email so it is a bit more attractive - to at least have a clickable link.
Looking in user-new.php, it doesn't appear to have an apply_filter.
How can I change this email without an apply_filter
The email is
You\'ve been invited to join \'%1$s\' at.
%2$s with the role of %3$s.
Please click the following link to confirm the invite:
%4$s'
Share
Improve this question
asked Mar 30, 2020 at 22:27
StripyTigerStripyTiger
2771 silver badge6 bronze badges
1 Answer
Reset to default 0There'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;
}