overrideEmail($args)) { add_action('phpmailer_init', [$this, 'blockEmailSending']); add_filter('post_smtp_do_send_email', [$this, 'blockEmailSendingPostSMTP']); } return $args; } public function blockEmailSending(&$phpmailer) { $phpmailer = new acyFakePhpMailer(); } public function blockEmailSendingPostSMTP($shouldSend) { return false; } } new acyOverrideEmail();