<?xml version="1.0" ?>

<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>
        <!-- Template Entities -->
        <service id="Shopware\Core\Content\MailTemplate\MailTemplateDefinition">
            <tag name="shopware.entity.definition"  entity="mail_template"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Aggregate\MailTemplateTranslation\MailTemplateTranslationDefinition">
            <tag name="shopware.entity.definition"  entity="mail_template_translation"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Aggregate\MailTemplateType\MailTemplateTypeDefinition">
            <tag name="shopware.entity.definition"  entity="mail_template_type"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Aggregate\MailTemplateTypeTranslation\MailTemplateTypeTranslationDefinition">
            <tag name="shopware.entity.definition"  entity="mail_template_type_translation"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Aggregate\MailTemplateMedia\MailTemplateMediaDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <!-- Header Footer Entities -->
        <service id="Shopware\Core\Content\MailTemplate\Aggregate\MailHeaderFooter\MailHeaderFooterDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Aggregate\MailHeaderFooterTranslation\MailHeaderFooterTranslationDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <!-- Controller -->
        <service id="Shopware\Core\Content\MailTemplate\Api\MailActionController" public="true">
            <argument type="service" id="Shopware\Core\Framework\Adapter\Twig\StringTemplateRenderer"/>
            <argument type="service" id="Shopware\Core\Content\MailTemplate\Service\MailTemplateService"/>
            <argument type="service" id="Shopware\Core\Content\MailTemplate\Service\MailTemplateSendService"/>
            <argument type="service" id="Shopware\Core\Content\Mail\Payload\MailPayloadFactory"/>
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Service\MailDataProvider">
            <argument type="tagged" tag="shopware.mail.data_provider" index-by="key"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Service\MailTemplateService">
            <argument type="service" id="mail_template.repository"/>
            <argument type="service" id="Shopware\Core\Framework\Adapter\Twig\StringTemplateRenderer"/>
            <argument type="service" id="Shopware\Core\Content\MailTemplate\Service\MailDataProvider"/>
            <argument type="service" id="Shopware\Core\Content\MailTemplate\Service\MailDataSimulator"/>
            <argument type="service" id="Shopware\Core\Content\MailTemplate\Service\MailTemplateContentBuilder"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Service\MailTemplateSendService">
            <argument type="service" id="Shopware\Core\Content\Mail\Service\MailService"/>
            <argument type="service" id="Shopware\Core\Content\MailTemplate\Service\MailDataProvider"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Service\MailTemplateContentBuilder"/>

        <service id="Shopware\Core\Content\MailTemplate\Service\MailDataSimulator">
            <argument type="service" id="Shopware\Core\Framework\Event\BusinessEventCollector"/>
            <argument type="service" id="Shopware\Core\Framework\DataAbstractionLayer\DefinitionInstanceRegistry"/>
            <argument type="service" id="event_dispatcher"/>
            <argument type="tagged" tag="shopware.mail.data_provider" index-by="key"/>
            <argument type="service" id="Psr\Clock\ClockInterface"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Request\Resolver\PreviewRequestResolver">
            <argument type="service" id="Shopware\Core\Content\MailTemplate\Service\MailTemplateService"/>
            <argument type="service" id="Shopware\Core\Content\Shared\MailFlow\DataProvider\SalesChannelProvider"/>
            <tag name="controller.argument_value_resolver"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Request\Resolver\GetDataAndSendRequestResolver">
            <argument type="service" id="Shopware\Core\Content\MailTemplate\Service\MailTemplateService"/>
            <argument type="service" id="Shopware\Core\Content\Mail\Payload\MailPayloadFactory"/>
            <tag name="controller.argument_value_resolver"/>
        </service>

        <service id="Shopware\Core\Content\MailTemplate\Request\Resolver\SimulateRequestResolver">
            <argument type="service" id="Shopware\Core\Content\Shared\MailFlow\DataProvider\SalesChannelProvider"/>
            <tag name="controller.argument_value_resolver"/>
        </service>
    </services>
</container>
