/** * Sends a warning to a user if they no longer have responders. * * @uses WP_Buoy_User::has_responder() * * @param WP_Buoy_Team $team The team that has been emptied. * * @return bool */ public static function warnIfNoResponder($team) { $buoy_user = new self($team->wp_post->post_author); if (false === $buoy_user->has_responder()) { // TODO: This should be a bit cleaner. Maybe part of the WP_Buoy_Notification class? $subject = __('You no longer have crisis responders.', 'buoy'); $msg = __('Either you have removed the last of your Buoy crisis response team members, or they have all left your teams. You will not be able to send a Buoy alert to anyone until you add more people to your team(s).', 'buoy'); wp_mail($buoy_user->wp_user->user_email, $subject, $msg); } }