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