WordPress User Registrations, Password Reset emails are using the pluggable.php file. (/wp-includes/pluggable.php) . There are two ways to achieve your request.
Modify the /wp-includes/pluggable.php file. : Not preferred/advised but an easy way. For the example above modify the line number 1903 (Referring to branch 5.0.2 https://core.trac.wordpress.org/browser/tags/5.0.1/src/wp-includes/pluggable.php#L0 )
Extend the functionality with functions.php In the following example, the user notification will redirect the user to different URL.
add_filter( 'wp_new_user_notification_email', 'custom_wp_new_user_notification_email', 10, 3 ); function custom_wp_new_user_notification_email( $wp_new_user_notification_email, $user, $blogname ) { $wp_new_user_notification_email['subject'] = sprintf( '[%s] New user %s registered.', $blogname, $user->user_login ); $wp_new_user_notification_email['message'] = sprintf( "%s ( %s ) has registerd to your blog %s.", $user->user_login, $user->user_email, "To Change your password visit: https://google.com" ); return $wp_new_user_notification_email; }
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.