You can intercept this email before it is sent using the phpmailer_init
hook.
By default, this hook fires before any email is sent. In the function below, $phpmailer
will be an instance of PHPMailer, and you can use its methods to remove the default recipient and manipulate the email before it is sent.
add_action('phpmailer_init', 'wse199274_intercept_registration_email');
function wse199274_intercept_registration_email($phpmailer){
$admin_email = get_option( 'admin_email' );
# Intercept username and password email by checking subject line
if( strpos($phpmailer->Subject, 'Your username and password info') ){
# clear the recipient list
$phpmailer->ClearAllRecipients();
# optionally, send the email to the WordPress admin email
$phpmailer->AddAddress($admin_email);
}else{
#not intercepted
}
}
Related Posts:
- Missing URL in password reset email
- How do I customise the new user welcome email
- User Without Email?
- How do I create a password reset link?
- Allow Duplicate Email Address for Different Users
- Email confirmation on registration
- Customizing lost password email
- Reset Password – change from name and email address
- Email as Username in registration
- Locked out of my own blog and password reset not working
- Change Password notification text on mail
- Handle registrations in WordPress when user doesn’t have any email?
- Email notification after registration in WordPress
- wordpress do not let user registered with info@ email and other reserved emails to get registered by users
- How do I make WordPress send an email to the user when his account gets approved (manual by me)
- User registration email and let user choose pasword
- 2 Email addresses for each user
- Emailing passwords: Setup installed on home server using XAMPP
- Script or plugin to send activation email automatically again after 2 hours
- how to email username and password to admin of new registration
- WordPress Won’t Send Email When a User Register
- Programming WordPress to Send an Email on Registration Form Submit?
- How do I troubleshoot registration/password email errors?
- Send clear password via mail
- Requiring wp-login.php sends headers automatically
- Resend password chosen by WP administrator? [duplicate]
- Changed my email. Locked out
- Auto Log In Users after registration and send confirmation email
- Send email for confirmation during user registration
- Changing old email to new email, lost the password
- Why would it take four reset password attempts to finally get the e-mail?
- Sending a password reset link
- User Without Email?
- Send user auto generated password on different email
- forgot password page with expiry link email of 60 minutes
- I need to verify emails when users signup
- Check if “Send the new user an email about their account” is ticked
- WP Mail isn’t sending user account messages, does send from plugins
- User Registration – no Email required
- Get emails of register user in WordPress
- Mail function not working with user accounts
- Duplicate notifications for new user registration
- Allowing Loading/Downloading of .mp3
- Create WP account from an external email form submission?
- Allow users to register as a higher role than default with code
- Cant login, Password MUST be reset error, after reset
- Is there a way to embed an iframe in an email with text that updates?
- prevent users from changing their email address
- How to disable automated E-Mail on PHP error/exception?
- Password reset message – change the network_home_url( ‘/’ )
- How to redirect action=register link on the lostpassword page to a different link?
- Sanitizing and validating email field
- Problem with logging in WP users automatically
- Batch Emails with wp_mail()
- Email ‘from address’ has a www in it
- Is there no way to send email using SMTP without plugin or custom coding?
- How to pass external variables to the wp_new_user_notification_email filter?
- Customize reset password form redirect problem
- Send email daily from WordPress site
- What’s wrong with Customizing new user notification email by add_filter?
- When admin changes a password for a registered user, I don’t want to send a password change email to users
- Is it possible to change an existing post status from ‘pending’ to ‘publish’ via email?
- WordPress email reply back to the original post author
- How to send mail from WordPress if one server hosts page and another email?
- Disable email confirmation new register bbPress [closed]
- Stop the execution of foreach loop which extract data from array?
- How to receive an email with WordPress?
- Generate Email if No Posts Within Time Period
- Content of post does not end up in “ShareThis” mail
- How to differentiate between email subscription list and blog subscription list?
- Disable password limitations
- What emails does wordpress send?
- How to stop WordPress from sending mails?
- Send confirmation email when a user’s role is upgraded
- WordPress site member verification emails going to spam on Outlook
- I want to setup a button/popup/whatever that will prompt users on the site to input their email address
- WordPress new user email formatting issues
- email saying that was not possible to send the email
- WordPress emails are not delivered if the recipient email address has a non-traditional domain extension
- could not call wp_email function twice
- Updated : how to make email optional while user registration using default wordpress form
- Is it possible to use different from email in contact form 7 with different domain?
- Email post to submitter
- How can I remove the product short description from the WooCommerce Mails?
- Email verification at a later date?
- Forgot password flow does not work, getting email with a link but after clicking link it’s not working
- Problem with login / reset password links in users emails
- Contact Form 7 How to Alter the From email address?
- email explanation for newbies
- Email Piping using google apps within WP Engine
- Download Free Trial After Email Entered
- User profile update author
- What is the correct way to send multipart email in wordpress?
- how can i inform other users about new user registration? [closed]
- What’s the simplest way to send WordPress posts to a Mailchimp list? [closed]
- Better way to change the default password reset url with the woocommerce one?
- Having Issue on Receiving Emails From @Gmail.com or @Yahoo. in WordPress Using PHP Mail Function
- How to add verification on email address change?
- Only Admin receives email
- Change password reqts with NO plugin without breaking resetpass link?