Skip to content

[DX][Mailer] Simplify the feature to send emails to some address in dev environment #36877

Closed
@javiereguiluz

Description

@javiereguiluz

Description
This nice option is very useful while working with emails in dev.

In Symfony 4.2 and earlier versions, you enabled it as follows:

# config/packages/dev/swiftmailer.yaml
swiftmailer:
    delivery_addresses: ['someone@example.com']

In Symfony 4.3 and newer, using the new Mailer, you enable it as follows:

# config/services_dev.yaml
services:
    mailer.dev.set_recipients:
        class: Symfony\Component\Mailer\EventListener\EnvelopeListener
        tags: ['kernel.event_subscriber']
        arguments:
            $sender: null
            $recipients: ['someone@example.com']

If technically possible, could we please make this feature as beautiful and simple as before? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)FeatureMailer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions