features_controller = $features_controller; $this->mailer = $mailer; $this->mailerMetaInfo = $mailerMetaInfo; } public function replaceWordPressMailer() { global $phpmailer; if ($this->features_controller->isSupported(FeaturesController::SEND_WORDPRESS_MAILS_WITH_MP3)) { return $this->replaceWithCustomPhpMailer($phpmailer); } return $phpmailer; } private function replaceWithCustomPhpMailer(&$obj = null) { $obj = new WordPressMailer($this->mailer, $this->mailerMetaInfo); return $obj; } }