<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Sales\Model\Order\CustomerManagement">
        <plugin name="Ddg_CustomerManagementPlugin" type="Dotdigitalgroup\Email\Plugin\CustomerManagementPlugin" sortOrder="1"/>
    </type>
    <type name="Magento\Newsletter\Model\Subscriber">
        <plugin name="ddg_newsletter_disabler" type="Dotdigitalgroup\Email\Plugin\SubscriberPlugin" sortOrder="1" disabled="false"/>
    </type>
    <type name="Magento\Customer\Model\Customer">
        <plugin name="ddg_customer_sendNewAccountEmail_disabler" type="Dotdigitalgroup\Email\Plugin\CustomerPlugin" sortOrder="1" disabled="false"/>
    </type>
    <type name="Magento\Customer\Model\EmailNotification">
        <plugin name="ddg_customer_email_disabler" type="Dotdigitalgroup\Email\Plugin\CustomerEmailNotificationPlugin" sortOrder="1" disabled="false"/>
    </type>
    <type name="Magento\SalesRule\Model\ResourceModel\Coupon">
        <plugin name="ddg_sales_coupon_expiration_date" type="Dotdigitalgroup\Email\Plugin\CouponPlugin" sortOrder="10" disabled="false"/>
    </type>
    <type name="Magento\Framework\Mail\Transport">
        <plugin name="ddg_mail_transport" type="Dotdigitalgroup\Email\Plugin\TransportPlugin" sortOrder="1" disabled="false" />
    </type>
    <type name="Magento\SalesRule\Model\ResourceModel\Rule\Collection">
        <plugin name="ddg_sales_rule_collection" type="Dotdigitalgroup\Email\Plugin\RuleCollectionPlugin"/>
    </type>
    <virtualType name="ContactCustomPrice" type="Magento\Framework\Pricing\Price\Pool">
        <arguments>
            <argument name="prices" xsi:type="array">
                <item name="final_price" xsi:type="string">Magento\ConfigurableProduct\Pricing\Price\FinalPrice</item>
            </argument>
            <argument name="target" xsi:type="object">Magento\Catalog\Pricing\Price\Pool</argument>
        </arguments>
    </virtualType>
    <virtualType name="dotdigitalgroupZendDate" type="Zend_Date">
        <arguments>
            <argument name="date" xsi:type="null"/>
            <argument name="part" xsi:type="null"/>
            <argument name="locale" xsi:type="null"/>
        </arguments>
    </virtualType>
    <type name="Dotdigitalgroup\Email\Model\Sales\Order">
        <arguments>
            <argument name="date" xsi:type="object">dotdigitalgroupZendDate</argument>
        </arguments>
    </type>
    <type name="Dotdigitalgroup\Email\Helper\Recommended">
        <arguments>
            <argument name="date" xsi:type="object">dotdigitalgroupZendDate</argument>
        </arguments>
    </type>
    <virtualType name="dotdigitalgroupZendMailTransportSendmail" type="Zend_Mail_Transport_Sendmail">
        <arguments>
            <argument name="parameters" xsi:type="null"/>
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="cron_report_grid_data_source" xsi:type="string">Magento\Cron\Ui\Model\ResourceModel\Schedule\Collection</item>
                <item name="rules_report_grid_data_source" xsi:type="string">Dotdigitalgroup\Email\Ui\Model\ResourceModel\Rules\Collection</item>
                <item name="importer_report_grid_data_source" xsi:type="string">Dotdigitalgroup\Email\Ui\Model\ResourceModel\Importer\Collection</item>
                <item name="automation_report_grid_data_source" xsi:type="string">Dotdigitalgroup\Email\Ui\Model\ResourceModel\Automation\Collection</item>
                <item name="campaign_report_grid_data_source" xsi:type="string">Dotdigitalgroup\Email\Ui\Model\ResourceModel\Campaign\Collection</item>
                <item name="contact_report_grid_data_source" xsi:type="string">Dotdigitalgroup\Email\Ui\Model\ResourceModel\Contact\Collection</item>
                <item name="catalog_report_grid_data_source" xsi:type="string">Dotdigitalgroup\Email\Ui\Model\ResourceModel\Catalog\Collection</item>
                <item name="order_report_grid_data_source" xsi:type="string">Dotdigitalgroup\Email\Ui\Model\ResourceModel\Order\Collection</item>
                <item name="review_report_grid_data_source" xsi:type="string">Dotdigitalgroup\Email\Ui\Model\ResourceModel\Review\Collection</item>
                <item name="wishlist_report_grid_data_source" xsi:type="string">Dotdigitalgroup\Email\Ui\Model\ResourceModel\Wishlist\Collection</item>
            </argument>
        </arguments>
    </type>
    <preference for="Dotdigitalgroup\Email\Model\Mail\AdapterInterface" type="Dotdigitalgroup\Email\Model\Mail\Transport" />
</config>