Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Merge pull request #38 from mageplaza/develop
Browse files Browse the repository at this point in the history
Clean code
  • Loading branch information
haitv282 authored Jul 16, 2020
2 parents d991c54 + b42e53e commit 9d0fdd4
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 152 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"liquid/liquid": "^1.4.8"
},
"type": "magento2-module",
"version": "1.1.2",
"version": "1.1.3",
"license": "proprietary",
"authors": [
{
Expand Down
68 changes: 34 additions & 34 deletions etc/adminhtml/di.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<?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_Webhook
* @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:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Ui\Model\Export\MetadataProvider">
<arguments>
<argument name="data" xsi:type="array">
<item name="mageplaza_webhook_managehooks_listing" xsi:type="array">
<item name="created_at" xsi:type="string">created_at</item>
<item name="updated_at" xsi:type="string">updated_at</item>
</item>
</argument>
</arguments>
</type>
</config>
<?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_Webhook
* @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:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Ui\Model\Export\MetadataProvider">
<arguments>
<argument name="data" xsi:type="array">
<item name="mageplaza_webhook_managehooks_listing" xsi:type="array">
<item name="created_at" xsi:type="string">created_at</item>
<item name="updated_at" xsi:type="string">updated_at</item>
</item>
</argument>
</arguments>
</type>
</config>
156 changes: 78 additions & 78 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
<?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_Webhook
* @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="mp_webhook" translate="label" type="text" sortOrder="300" showInDefault="1">
<class>separator-top</class>
<label>Webhook</label>
<tab>mageplaza</tab>
<resource>Mageplaza_Webhook::configuration</resource>
<group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<label>General</label>
<field id="enabled" translate="label comment" type="select" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Enable</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment><![CDATA[<a href="https://www.mageplaza.com/kb/webhook/" target="_blank">How to integrate with others</a>]]></comment>
</field>
<field id="abandoned_time" translate="label comment" type="text" sortOrder="2" showInDefault="1" canRestore="1">
<label>Abandoned Cart After</label>
<validate>validate-digits</validate>
<comment>How to deteminte as Abandonded Cart. Enter number of hour(s). Recommend: 1, 6, 10, 12, 24. Default: 10</comment>
</field>
<field id="keep_log" translate="label comment" type="text" sortOrder="10" showInDefault="1" canRestore="1">
<label>Keep logs</label>
<validate>validate-digits</validate>
<comment>The number of logs will be kept in each hook. If it reaches this number, the old logs will be removed. If empty or zero, no limitation. Default: 10</comment>
</field>
<field id="alert_enabled" translate="label comment" type="select" sortOrder="20" showInDefault="1" canRestore="1">
<label>Alert on Error</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment><![CDATA[Send alert email to your email addresses if any error. To avoid going to spambox, you should install <a href="https://www.mageplaza.com/magento-2-smtp/" target="_blank">SMTP</a>]]></comment>
</field>
<field id="send_to" translate="label comment" type="text" sortOrder="10" showInDefault="1">
<label>Send To</label>
<backend_model>Mageplaza\Webhook\Model\Config\Backend\Email</backend_model>
<comment>Separated by comma (,)</comment>
</field>
<field id="email_template" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Email Template</label>
<source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>
</field>
</group>
<group id="cron" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Schedule For Cron</label>
<field id="schedule" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1" >
<label>Schedule For Cron</label>
<source_model>Mageplaza\Webhook\Model\Config\Source\Schedule</source_model>
<comment><![CDATA[Applied for Processing Type as Cron]]></comment>
</field>
<field id="start_time" translate="label" type="time" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
<label>Start Time</label>
<depends>
<field id="schedule" separator=",">day,week,month</field>
</depends>
</field>
</group>
</section>
</system>
</config>
<?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_Webhook
* @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="mp_webhook" translate="label" type="text" sortOrder="300" showInDefault="1">
<class>separator-top</class>
<label>Webhook</label>
<tab>mageplaza</tab>
<resource>Mageplaza_Webhook::configuration</resource>
<group id="general" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<label>General</label>
<field id="enabled" translate="label comment" type="select" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Enable</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment><![CDATA[<a href="https://www.mageplaza.com/kb/webhook/" target="_blank">How to integrate with others</a>]]></comment>
</field>
<field id="abandoned_time" translate="label comment" type="text" sortOrder="2" showInDefault="1" canRestore="1">
<label>Abandoned Cart After</label>
<validate>validate-digits</validate>
<comment>How to deteminte as Abandonded Cart. Enter number of hour(s). Recommend: 1, 6, 10, 12, 24. Default: 10</comment>
</field>
<field id="keep_log" translate="label comment" type="text" sortOrder="10" showInDefault="1" canRestore="1">
<label>Keep logs</label>
<validate>validate-digits</validate>
<comment>The number of logs will be kept in each hook. If it reaches this number, the old logs will be removed. If empty or zero, no limitation. Default: 10</comment>
</field>
<field id="alert_enabled" translate="label comment" type="select" sortOrder="20" showInDefault="1" canRestore="1">
<label>Alert on Error</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<comment><![CDATA[Send alert email to your email addresses if any error. To avoid going to spambox, you should install <a href="https://www.mageplaza.com/magento-2-smtp/" target="_blank">SMTP</a>]]></comment>
</field>
<field id="send_to" translate="label comment" type="text" sortOrder="10" showInDefault="1">
<label>Send To</label>
<backend_model>Mageplaza\Webhook\Model\Config\Backend\Email</backend_model>
<comment>Separated by comma (,)</comment>
</field>
<field id="email_template" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Email Template</label>
<source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>
</field>
</group>
<group id="cron" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Schedule For Cron</label>
<field id="schedule" translate="label comment" type="select" sortOrder="30" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1" >
<label>Schedule For Cron</label>
<source_model>Mageplaza\Webhook\Model\Config\Source\Schedule</source_model>
<comment><![CDATA[Applied for Processing Type as Cron]]></comment>
</field>
<field id="start_time" translate="label" type="time" sortOrder="40" showInDefault="1" showInWebsite="0" showInStore="0" canRestore="1">
<label>Start Time</label>
<depends>
<field id="schedule" separator=",">day,week,month</field>
</depends>
</field>
</group>
</section>
</system>
</config>
78 changes: 39 additions & 39 deletions etc/config.xml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<?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_Webhook
* @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_Store:etc/config.xsd">
<default>
<mp_webhook>
<general>
<enabled>1</enabled>
<abandoned_time>10</abandoned_time>
<keep_log>10</keep_log>
<alert_enabled>0</alert_enabled>
<email_template>mp_webhook_general_email_template</email_template>
</general>
<cron>
<schedule>0</schedule>
<start_time>00,00,00</start_time>
</cron>
</mp_webhook>
</default>
</config>
<?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_Webhook
* @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_Store:etc/config.xsd">
<default>
<mp_webhook>
<general>
<enabled>1</enabled>
<abandoned_time>10</abandoned_time>
<keep_log>10</keep_log>
<alert_enabled>0</alert_enabled>
<email_template>mp_webhook_general_email_template</email_template>
</general>
<cron>
<schedule>0</schedule>
<start_time>00,00,00</start_time>
</cron>
</mp_webhook>
</default>
</config>
1 change: 1 addition & 0 deletions i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Hook,Hook
"The hook has been saved.","The hook has been saved."
"Something went wrong while sending %1 hook","Something went wrong while sending %1 hook"
"Cannot connect to server. Please try again later.","Cannot connect to server. Please try again later."
"Invalid email format.","Invalid email format."
"--Please Select--","--Please Select--"
Basic,Basic
Digest,Digest
Expand Down

0 comments on commit 9d0fdd4

Please sign in to comment.