public function getMailer()
    {
        if (is_null($this->mailer)) {
            if(class_exists('\Swift'))
            {
                if(version_compare(\Swift::VERSION, 4, '<=') && version_compare(\Swift::VERSION, 3, '>='))
                {
                    $mailer = new Email\Swift3($this->config);
                }
                else {
                    $mailer = new Email\Swift5($this->config);
                }
            }
            else {
                $mailer = new Email\Swift5($this->config); 
            }
            
            $this->mailer = $mailer;
        }
        
        return $this->mailer;
    }