getTransport() public static method

Returns an instance of TransportInterface based on current bridge.
public static getTransport ( string $mailer ) : Webiny\Component\Mailer\TransportInterface
$mailer string
return Webiny\Component\Mailer\TransportInterface
コード例 #1
0
ファイル: LoaderTest.php プロジェクト: Webiny/Framework
 public function testGetTransport()
 {
     $this->assertInstanceOf('\\Webiny\\Component\\Mailer\\Bridge\\TransportInterface', Loader::getTransport('Default'));
 }
コード例 #2
0
ファイル: Mailer.php プロジェクト: Nkelliny/Framework
 /**
  * Base constructor.
  *
  * @param string $mailer Key of the mailer configuration.
  *
  * @throws MailerException
  */
 public function __construct($mailer = 'Default')
 {
     $this->mailerName = $mailer;
     $this->transport = Loader::getTransport($mailer);
 }