Home / Archive / MemberPress: Change the Recipient of the “WARNING! Your Business is at Risk” Email
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Change the Recipient of the “WARNING! Your Business is at Risk” Email

By default, the email titled "WARNING! Your Business is at Risk" is sent to the admin email set in MemberPress settings. The following code snippet will divert this e-mail to another administrator's email.

In this example code, it is the administrator with the [email protected] email:

Code Preview
php
<?php
add_filter('mepr-wp-mail-recipients', function($recipients, $subject, $message, $headers) {
  if((strpos($subject, 'Your Business is at Risk') !== false)) {
    foreach ($recipients as $key => $recipient) {
      if('[email protected]' !== $recipient) {
        unset($recipients[$key]);
      }
    }
  }
  return $recipients;
}, 10, 4);

Comments

Add a Comment