protected function getSwiftMailer()
    {

        // the swift mailer configuration
        if ($swiftMailerConfiguration = $this->getPluginConfiguration()->getSwiftMailer()) {
            // load the factory that creates the swift mailer instance
            $factory = $swiftMailerConfiguration->getFactory();
            // create the swift mailer instance
            return $factory::factory($swiftMailerConfiguration);
        }
    }