Skip to content
This repository was archived by the owner on Feb 6, 2022. It is now read-only.

Allow to setup transports via URL #118

Merged
merged 1 commit into from
Jan 14, 2016
Merged

Allow to setup transports via URL #118

merged 1 commit into from
Jan 14, 2016

Conversation

kingcrunch
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #101
License MIT
Doc PR -

For example as YML

swiftmailer:
    default_mailer: smtp_mailer
    mailers:
        smtp_mailer:
            url: smtp://username:[email protected]:12345?encryption=tls&auth_mode=login

This is primary useful for SMTP-transports. There is no benefit, for "sendmail"-, or "mail"-transports. The intention is, that one only needs to set up one config option/parameter to define a working transport. For example see parameters.yml of symfony/symfony-standard

    mailer_transport:  smtp
    mailer_host:       127.0.0.1
    mailer_user:       ~
    mailer_password:   ~

For different stages one usually must set at least "user" and "password" and often "host" too for every stage. With this patch it would look like

mailer_url: 'smtp://127.0.0.1'

@fabpot
Copy link
Member

fabpot commented Jan 14, 2016

Thank you @kingcrunch.

@fabpot fabpot merged commit 49219dc into symfony:master Jan 14, 2016
fabpot added a commit that referenced this pull request Jan 14, 2016
This PR was merged into the 2.3-dev branch.

Discussion
----------

Allow to setup transports via URL

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #101
| License       | MIT
| Doc PR        | -

For example as YML

```yml
swiftmailer:
    default_mailer: smtp_mailer
    mailers:
        smtp_mailer:
            url: smtp://username:[email protected]:12345?encryption=tls&auth_mode=login
```

This is primary useful for SMTP-transports. There is no benefit, for "sendmail"-, or "mail"-transports. The intention is, that one only needs to set up one config option/parameter to define a working transport. For example see [`parameters.yml` of `symfony/symfony-standard`](https://github.com/symfony/symfony-standard/blob/2.8/app/config/parameters.yml.dist#L13-L16)

```yml
    mailer_transport:  smtp
    mailer_host:       127.0.0.1
    mailer_user:       ~
    mailer_password:   ~
```

For different stages one usually must set at least "user" and "password" and often "host" too for every stage. With this patch it would look like

```
mailer_url: 'smtp://127.0.0.1'
```

Commits
-------

49219dc Allow to setup transports via URL
xabbuh added a commit to xabbuh/symfony-docs that referenced this pull request Apr 30, 2017
* The `url` option was added in version 2.3.10 of the SwiftmailerBundle
  (see symfony/swiftmailer-bundle#118).
* The `timeout` and `source_ip` options are part of SwiftmailerBundle
  since symfony/swiftmailer-bundle#14 which was part of the 2.1.0
  release.
* The `local_domain` option was first included in the 2.4.0 release (see
  symfony/swiftmailer-bundle#141).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants