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
Example #1
0
 public function testGetTransport()
 {
     $this->assertInstanceOf('\\Webiny\\Component\\Mailer\\Bridge\\TransportInterface', Loader::getTransport('Default'));
 }
Example #2
0
 /**
  * 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);
 }