PHP Class Webiny\Component\Mailer\Bridge\SwiftMailer\Transport

Inheritance: implements Webiny\Component\Mailer\Bridge\TransportInterface
Show file Open project: Webiny/Framework Class Usage Examples

Public Methods

Method Description
__construct ( ConfigObject $config ) Base constructor.
getDebugLog ( ) : array Returns the debug log.
getTransportInstance ( ) : Swift_Transport Returns the current Swift_Transport instance.
send ( Webiny\Component\Mailer\MessageInterface $message, array | null &$failures = null ) : boolean | integer Sends the message.
setDecorators ( array $replacements ) Decorators are arrays that contain keys and values. The message body and subject will be scanned for the keys, and, where found, the key will be replaced with the value.

Private Methods

Method Description
registerPlugins ( ConfigObject $config ) Registers SwiftMailer plugins based on the provided $config.

Method Details

__construct() public method

In the base constructor the bridge gets the mailer configuration.
public __construct ( ConfigObject $config )
$config Webiny\Component\Config\ConfigObject The base configuration.

getDebugLog() public method

Note that SwiftMailer requires you set 'Debug: true' in your config.
public getDebugLog ( ) : array
return array

getTransportInstance() public method

Returns the current Swift_Transport instance.
public getTransportInstance ( ) : Swift_Transport
return Swift_Transport

send() public method

Sends the message.
public send ( Webiny\Component\Mailer\MessageInterface $message, array | null &$failures = null ) : boolean | integer
$message Webiny\Component\Mailer\MessageInterface Message you want to send.
$failures array | null To this array failed addresses will be stored.
return boolean | integer Number of success sends, or bool FALSE if sending failed.

setDecorators() public method

Decorators are arrays that contain keys and values. The message body and subject will be scanned for the keys, and, where found, the key will be replaced with the value.
public setDecorators ( array $replacements )
$replacements array Array [email=> [key1=>value1, key2=>value2], email2=>[...]].