<?xml version="1.0"?><!--
/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_Smtp
 * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="smtp" translate="label" type="text" sortOrder="300" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>SMTP</label>
            <tab>mageplaza</tab>
            <resource>Mageplaza_Smtp::configuration</resource>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>General Configuration</label>
                <field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Enable Mageplaza SMTP</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment><![CDATA[Mageplaza SMTP is compatible with default Magento SMTP and other email modules.<br />
                        It helps to reduce abandonment cart with <a href="https://www.mageplaza.com/magento-2-one-step-checkout-extension/" target="_blank">One Step Checkout</a>. Fully compatible with <a href="https://www.mageplaza.com/magento-2-abandoned-cart-email/" target="_blank">Abandoned Cart Email</a>]]>
                    </comment>
                </field>
                <field id="log_email" translate="label comment" type="select" sortOrder="15" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Log Emails</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment>It will log all sent emails, you can preview it and schedule clean up.</comment>
                </field>
                <field id="clean_email" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Clean Email Log Every</label>
                    <validate>validate-number validate-zero-or-greater validate-digits</validate>
                    <comment>Day(s). If empty or zero, the Email log will not be cleaned.</comment>
                    <depends>
                        <field id="log_email">1</field>
                    </depends>
                </field>
                <field id="blacklist" translate="label comment" type="textarea" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Blacklist</label>
                    <comment><![CDATA[Enter the main email pattern format. Separated by line breaks.<br />
                        For the email having the same pattern format with this main pattern, it can not receive email from the system.<br />
                        For example: Enter the pattern: /^[0-9][a-z0-9\$\%\&]+@[a-z]+\.[a-z]{2,}$/ means that email format must start with number, the following characters can be normal text, number or special character ($, %, &). The domain after @ with normal-text characters will not receive email from system. For instance: 1abc@example.com</br>
                        For more details of writing email pattern, please see it <a href=" https://docs.mageplaza.com/smtp-m2/index.html" target="_blank">here</a>.]]>
                    </comment>
                </field>
            </group>
            <group id="configuration_option" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>SMTP Configuration Options</label>
                <field id="host" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Host</label>
                    <comment>Support Host name and IP Address</comment>
                    <frontend_model>Mageplaza\Smtp\Block\Adminhtml\System\Config\Host</frontend_model>
                </field>
                <field id="port" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Port</label>
                    <comment>Default ports: 25, 465, or 587. Port 465 (SSL required), Port 587 (TLS required)</comment>
                </field>
                <field id="protocol" translate="label comment" type="select" sortOrder="35" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Protocol</label>
                    <source_model>Mageplaza\Smtp\Model\Config\Source\Protocol</source_model>
                    <comment>We recommend use security connections: SSL or TLS. Secure Socket Layer (SSL), Transport Layer Security (TLS) protocols.</comment>
                </field>
                <field id="authentication" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Authentication</label>
                    <source_model>Mageplaza\Smtp\Model\Config\Source\Authentication</source_model>
                </field>
                <field id="username" translate="label" type="text" sortOrder="60" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Username</label>
                </field>
                <field id="password" translate="label" type="obscure" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Password</label>
                    <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
                </field>
                <field id="return_path_email" translate="label comment" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Return-Path Email</label>
                    <comment>Leave empty to ignore it.</comment>
                    <validate>validate-email</validate>
                </field>
                <group id="test_email" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Send Test Email</label>
                    <field id="from" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Send From</label>
                        <source_model>Magento\Config\Model\Config\Source\Email\Identity</source_model>
                    </field>
                    <field id="to" translate="label" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label>Send To</label>
                        <comment><![CDATA[<p class="note"><span>Enter your email and click <b>Test Now</b> button to test the configuration. <br>
                            Read: <br>
                            - <a href="https://www.mageplaza.com/faqs/smtp/" target="_blank">FAQs</a><br>
                            - <a href="https://www.mageplaza.com/faqs/smtp-connection-timed-out.html" target="_blank">Connection timed out</a>
                        </span>
                        </p>]]>
                        </comment>
                    </field>
                    <field id="sent" translate="label" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                        <label></label>
                        <button_label>Test Now</button_label>
                        <button_url>adminhtml/smtp/test</button_url>
                        <frontend_model>Mageplaza\Smtp\Block\Adminhtml\System\Config\Button</frontend_model>
                    </field>
                </group>
            </group>
            <group id="abandoned_cart" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Email Marketing</label>
                <field id="enabled" translate="label comment" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Enable</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment>Select Yes to enable this feature.</comment>
                </field>
                <field id="measure" translate="label comment" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>How to measure Abandoned Cart</label>
                    <comment><![CDATA[Time to define an abandoned cart. The unit is minute. Default value is 30.</br> Example: If we enter 30, then after 30 minutes, carts will be considered abandoned. The carts under 30 minutes will be considered as a real-time cart.]]></comment>
                    <validate>validate-digits validate-digits-range digits-range-0-1440</validate>
                </field>
                <field id="app_id" translate="label comment" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>App ID</label>
                    <comment><![CDATA[Create API key <a href="https://app.avada.io/manage/keys" target="_blank">here</a>.]]></comment>
                </field>
                <field id="secret_key" translate="label comment" type="obscure" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Secret key</label>
                    <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
                </field>
                <field id="test_connection" translate="label" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label></label>
                    <button_label>Test connection</button_label>
                    <button_url>adminhtml/smtp/testconnection</button_url>
                    <frontend_model>Mageplaza\Smtp\Block\Adminhtml\System\Config\TestConnection</frontend_model>
                </field>
            </group>
            <group id="developer" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Developer</label>
                <field id="developer_mode" translate="label comment" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Developer Mode</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                    <comment>If Enable, Magento will not delivery any email to receiver. This is useful for developers.</comment>
                </field>
            </group>
        </section>
    </system>
</config>
