Skip to content

Commit 75c1c0c

Browse files
author
Benjamin Laugueux
committed
Added mailer configuration.
1 parent 1fc0864 commit 75c1c0c

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public function getConfigTreeBuilder()
105105
->end()
106106
->scalarNode('subject')->end() // swift_mailer and native_mailer
107107
->scalarNode('content_type')->defaultNull()->end() // swift_mailer
108+
->scalarNode('mailer')->defaultValue('mailer')->end() // swift_mailer
108109
->arrayNode('email_prototype') // swift_mailer
109110
->canBeUnset()
110111
->beforeNormalization()

DependencyInjection/MonologExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ private function buildHandler(ContainerBuilder $container, $name, array $handler
251251
$prototype = new Reference($messageId);
252252
}
253253
$definition->setArguments(array(
254-
new Reference('mailer'),
254+
new Reference($handler['mailer']),
255255
$prototype,
256256
$handler['level'],
257257
$handler['bubble'],

Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public function testWithSwiftMailerHandler()
196196
'from_email' => '[email protected]',
197197
'to_email' => '[email protected]',
198198
'subject' => 'Subject',
199+
'mailer' => 'mailer',
199200
'email_prototype' => array(
200201
'id' => 'monolog.prototype',
201202
'method' => 'getPrototype'
@@ -211,6 +212,7 @@ public function testWithSwiftMailerHandler()
211212
$this->assertCount(2, $config['handlers']['swift']['email_prototype']);
212213
$this->assertEquals('monolog.prototype', $config['handlers']['swift']['email_prototype']['id']);
213214
$this->assertEquals('getPrototype', $config['handlers']['swift']['email_prototype']['method']);
215+
$this->assertEquals('mailer', $config['handlers']['swift']['mailer']);
214216
}
215217

216218
public function testWithType()

0 commit comments

Comments
 (0)