bug #32556 [Mailer] Add XML configuration for the mailer envelope (fabpot)
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Add XML configuration for the mailer envelope
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.
Additionally (see https://symfony.com/roadmap):
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too).
- Features and deprecations must be submitted against branch 4.4.
- Legacy code removals go to the master branch.
-->
Commits
-------
2e03f9dfa5
[Mailer] added XML configuration for the mailer envelope
This commit is contained in:
commit
da6cbab742
@ -555,6 +555,16 @@
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="mailer">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="envelope" type="mailer_envelope" minOccurs="0" maxOccurs="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="dsn" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
|
||||
<xsd:complexType name="mailer_envelope">
|
||||
<xsd:sequence>
|
||||
<xsd:element name="sender" type="xsd:string" />
|
||||
<xsd:element name="recipients" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xsd:sequence>
|
||||
</xsd:complexType>
|
||||
</xsd:schema>
|
||||
|
@ -3,5 +3,9 @@
|
||||
$container->loadFromExtension('framework', [
|
||||
'mailer' => [
|
||||
'dsn' => 'smtp://example.com',
|
||||
'envelope' => [
|
||||
'sender' => 'sender@example.org',
|
||||
'recipients' => ['redirected@example.org', 'redirected1@example.org'],
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
@ -7,6 +7,12 @@
|
||||
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
|
||||
|
||||
<framework:config>
|
||||
<framework:mailer dsn="smtp://example.com" />
|
||||
<framework:mailer dsn="smtp://example.com">
|
||||
<framework:envelope>
|
||||
<framework:sender>sender@example.org</framework:sender>
|
||||
<framework:recipients>redirected@example.org</framework:recipients>
|
||||
<framework:recipients>redirected1@example.org</framework:recipients>
|
||||
</framework:envelope>
|
||||
</framework:mailer>
|
||||
</framework:config>
|
||||
</container>
|
||||
|
@ -1,3 +1,8 @@
|
||||
framework:
|
||||
mailer:
|
||||
dsn: 'smtp://example.com'
|
||||
envelope:
|
||||
sender: sender@example.org
|
||||
recipients:
|
||||
- redirected@example.org
|
||||
- redirected1@example.org
|
||||
|
@ -1588,6 +1588,10 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertTrue($container->hasAlias('mailer'));
|
||||
$this->assertTrue($container->hasDefinition('mailer.default_transport'));
|
||||
$this->assertSame('smtp://example.com', $container->getDefinition('mailer.default_transport')->getArgument(0));
|
||||
$this->assertTrue($container->hasDefinition('mailer.envelope_listener'));
|
||||
$l = $container->getDefinition('mailer.envelope_listener');
|
||||
$this->assertSame('sender@example.org', $l->getArgument(0));
|
||||
$this->assertSame(['redirected@example.org', 'redirected1@example.org'], $l->getArgument(1));
|
||||
}
|
||||
|
||||
protected function createContainer(array $data = [])
|
||||
|
Reference in New Issue
Block a user