Crunz\Mailer::getMailer PHP Method

getMailer() protected method

Return the proper mailer
protected getMailer ( ) : Swift_Mailer
return Swift_Mailer
    protected function getMailer()
    {
        // If the mailer has already been defined via the constructor, return it.
        if ($this->mailer) {
            return $this->mailer;
        }
        // Get the proper transporter
        switch ($this->config('mailer.transport')) {
            case 'smtp':
                $transport = $this->getSmtpTransport();
                break;
            case 'mail':
                $transport = $this->getMailTranport();
                break;
            default:
                $transport = $this->getSendMailTransport();
        }
        return \Swift_Mailer::newInstance($transport);
    }