Description
This filter hook can override the email address that is used to send admin notification when a new user registers. The default address used by the plugin is the address that is set in the WordPress General Settings (admin menu Settings > General). This filter can change the email address, either single or multiple addresses.
Parameters
$email
(string)(required) The email to send notifications to (use comma separated string for multiple emails)
Useage
/**
* This is a single email example. To change the
* notification address just return the filtered result.
*/
add_filter( 'wpmem_notify_addr', function( $email ) {
return 'notify@mydomain.com';
});
/**
* This is a multiple email example. Note that your outgoing
* mail server must support receiving multiple emails as
* comma separated values for this to be supported.
*/
add_filter( 'wpmem_notify_addr', function( $email ) {
return 'notify1@mydomain.com, notify2@mydomain.com';
});
/**
* Notification addresses can be changed based on your own
* crititeria, supposing you know a little PHP.
*/
add_filter( 'wpmem_notify_addr', function( $email ) {
// Change the email based on your own custom logic.
if ( $some_criteria ) {
$email = 'some_other_email@mydomain.com';
}
return $email;
});Changelog
- Introduced in 2.7.5
Source
wpmem_notify_addr is located in includes/class-wp-members-email.php