|
@@ -68,16 +68,19 @@ class SwiftmailerExtension extends Extension
|
|
$loader->load('smtp.xml');
|
|
$loader->load('smtp.xml');
|
|
}
|
|
}
|
|
|
|
|
|
- $container->setParameter('swiftmailer.transport.name', $transport);
|
|
|
|
|
|
+ if (in_array($transport, array('smtp', 'mail', 'sendmail', 'null'))) {
|
|
|
|
+ // built-in transport
|
|
|
|
+ $transport = 'swiftmailer.transport.'.$transport;
|
|
|
|
+ }
|
|
|
|
|
|
- $container->setAlias('swiftmailer.transport', 'swiftmailer.transport.'.$transport);
|
|
|
|
|
|
+ $container->setAlias('swiftmailer.transport', $transport);
|
|
|
|
|
|
if (false === $config['port']) {
|
|
if (false === $config['port']) {
|
|
$config['port'] = 'ssl' === $config['encryption'] ? 465 : 25;
|
|
$config['port'] = 'ssl' === $config['encryption'] ? 465 : 25;
|
|
}
|
|
}
|
|
|
|
|
|
foreach (array('encryption', 'port', 'host', 'username', 'password', 'auth_mode') as $key) {
|
|
foreach (array('encryption', 'port', 'host', 'username', 'password', 'auth_mode') as $key) {
|
|
- $container->setParameter('swiftmailer.transport.'.$transport.'.'.$key, $config[$key]);
|
|
|
|
|
|
+ $container->setParameter('swiftmailer.transport.smtp.'.$key, $config[$key]);
|
|
}
|
|
}
|
|
|
|
|
|
// spool?
|
|
// spool?
|
|
@@ -85,7 +88,7 @@ class SwiftmailerExtension extends Extension
|
|
$type = $config['spool']['type'];
|
|
$type = $config['spool']['type'];
|
|
|
|
|
|
$loader->load('spool.xml');
|
|
$loader->load('spool.xml');
|
|
- $container->setAlias('swiftmailer.transport.real', 'swiftmailer.transport.'.$transport);
|
|
|
|
|
|
+ $container->setAlias('swiftmailer.transport.real', $transport);
|
|
$container->setAlias('swiftmailer.transport', 'swiftmailer.transport.spool');
|
|
$container->setAlias('swiftmailer.transport', 'swiftmailer.transport.spool');
|
|
$container->setAlias('swiftmailer.spool', 'swiftmailer.spool.'.$type);
|
|
$container->setAlias('swiftmailer.spool', 'swiftmailer.spool.'.$type);
|
|
|
|
|