Skip to content

Commit

Permalink
Add a Symfony 4 configuration example
Browse files Browse the repository at this point in the history
  • Loading branch information
Finesse committed Oct 25, 2019
1 parent f40b844 commit 7f24473
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Expand Up @@ -60,8 +60,25 @@ $mailer = new Swift_Mailer($transport);
$mailer->registerPlugin($defaultsPlugin);
```

For [Symfony](https://github.com/symfony/swiftmailer-bundle) you can register the plugin this way:
For [Symfony](https://github.com/symfony/swiftmailer-bundle) 4 you can register the plugin this way:

```yaml
services:
# Swift Mailer plugins
Finesse\SwiftMailerDefaultsPlugin\SwiftMailerDefaultsPlugin:
tags:
- { name: swiftmailer.default.plugin }
arguments:
$defaults:
from:
johndoe@example.com: John Doe
replyTo: jackdoe@example.com

```

<details>
<summary>Symfony 3 example</summary>

```yaml
services:
# Swift Mailer plugins
Expand All @@ -77,6 +94,8 @@ services:

```

</details>

When you need to send an email, just send it without specifying the parameters you set to the plugin instance.

```php
Expand Down

0 comments on commit 7f24473

Please sign in to comment.