public function __construct() { $orangehrmMailTransport = new orangehrmMailTransport(); $this->transport = $orangehrmMailTransport->getTransport(); $this->mailer = empty($this->transport) ? null : Swift_Mailer::newInstance($this->transport); $this->message = Swift_Message::newInstance(); $this->logPath = ROOT_PATH . '/lib/logs/notification_mails.log'; }
protected function getMailer($recreate = false) { if (empty($this->mailer) || $recreate) { $orangehrmMailTransport = new orangehrmMailTransport(); $transport = $orangehrmMailTransport->getTransport(); if (!empty($transport)) { $mailer = Swift_Mailer::newInstance($transport); } else { $this->logger->warn('Email configuration settings not available'); } } return $mailer; }