<?xml version="1.0" encoding="UTF-8" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="mailer.mailer" class="Symfony\Component\Mailer\Mailer">
            <argument type="service" id="mailer.transports" />
            <argument type="service" id="messenger.default_bus" on-invalid="ignore" />
            <argument type="service" id="event_dispatcher" on-invalid="ignore" />
        </service>
        <service id="mailer" alias="mailer.mailer" />
        <service id="Symfony\Component\Mailer\MailerInterface" alias="mailer.mailer" />

        <service id="mailer.transports" class="Symfony\Component\Mailer\Transport\Transports">
            <factory service="mailer.transport_factory" method="fromStrings" />
            <argument type="collection" /> <!-- transports -->
        </service>

        <service id="mailer.transport_factory" class="Symfony\Component\Mailer\Transport">
            <argument type="tagged_iterator" tag="mailer.transport_factory" />
        </service>

        <service id="mailer.default_transport" class="Symfony\Component\Mailer\Transport\TransportInterface">
            <factory service="mailer.transport_factory" method="fromString" />
            <argument /> <!-- env(MAILER_DSN) -->
        </service>
        <service id="Symfony\Component\Mailer\Transport\TransportInterface" alias="mailer.default_transport" />

        <service id="mailer.messenger.message_handler" class="Symfony\Component\Mailer\Messenger\MessageHandler">
            <argument type="service" id="mailer.transports" />
            <tag name="messenger.message_handler" />
        </service>

        <service id="mailer.envelope_listener" class="Symfony\Component\Mailer\EventListener\EnvelopeListener">
            <argument /> <!-- sender -->
            <argument /> <!-- recipients -->
            <tag name="kernel.event_subscriber"/>
        </service>

        <service id="mailer.logger_message_listener" class="Symfony\Component\Mailer\EventListener\MessageLoggerListener">
            <tag name="kernel.event_subscriber"/>
            <tag name="kernel.reset" method="reset" />
        </service>
    </services>
</container>
