From a2febf4c3638810c447b91c43282ce50089f0f47 Mon Sep 17 00:00:00 2001 From: eric Date: Wed, 8 Jul 2020 11:41:15 +0700 Subject: [PATCH 1/3] update compatible 2.3.5 --- Model/Config/Backend/Email.php | 49 ++++++++++ etc/adminhtml/system.xml | 166 +++++++++++++++++---------------- 2 files changed, 133 insertions(+), 82 deletions(-) create mode 100644 Model/Config/Backend/Email.php diff --git a/Model/Config/Backend/Email.php b/Model/Config/Backend/Email.php new file mode 100644 index 0000000..3adb992 --- /dev/null +++ b/Model/Config/Backend/Email.php @@ -0,0 +1,49 @@ +getValue())) { + $valueArray = explode(',', $this->getValue()); + foreach ($valueArray as $value) { + if (!filter_var($value, FILTER_VALIDATE_EMAIL)) { + throw new ValidatorException(__('Invalid email format.')); + } + } + } + parent::beforeSave(); // TODO: Change the autogenerated stub + } +} diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 5e992a7..47efd41 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1,82 +1,84 @@ - - - - -
- - mageplaza - Mageplaza_EmailAttachments::configuration - - - - - Magento\Config\Model\Config\Source\Yesno - Yes to enable the module.]]> - - - - Comma-separated - - - - Comma-separated - - - - Magento\Config\Model\Config\Source\Yesno - - - - Mageplaza\EmailAttachments\Model\Config\Source\AttachPdf - 1 - PDF files for the above billing document(s) will be generated and attached to emails. - - 1 - - - - - Magento\Config\Model\Config\Source\Yesno - - - - Mageplaza\EmailAttachments\Model\Config\Source\AttachTaC - 1 - 'Terms and Conditions' will be attached to the above billing document(s) as a file. - - 1 - - - - - Mageplaza\EmailAttachments\Model\Config\Backend\TaCFile - Allowed upload file types: .pdf, .doc, .docx, .txt - mageplaza/email_attachments - - 1 - - - -
-
-
+ + + + +
+ + mageplaza + Mageplaza_EmailAttachments::configuration + + + + + Magento\Config\Model\Config\Source\Yesno + Yes to enable the module.]]> + + + + Mageplaza\Webhook\Model\Config\Backend\Email + Comma-separated + + + + Mageplaza\Webhook\Model\Config\Backend\Email + Comma-separated + + + + Magento\Config\Model\Config\Source\Yesno + + + + Mageplaza\EmailAttachments\Model\Config\Source\AttachPdf + 1 + PDF files for the above billing document(s) will be generated and attached to emails. + + 1 + + + + + Magento\Config\Model\Config\Source\Yesno + + + + Mageplaza\EmailAttachments\Model\Config\Source\AttachTaC + 1 + 'Terms and Conditions' will be attached to the above billing document(s) as a file. + + 1 + + + + + Mageplaza\EmailAttachments\Model\Config\Backend\TaCFile + Allowed upload file types: .pdf, .doc, .docx, .txt + mageplaza/email_attachments + + 1 + + + +
+
+
From 84cbef833c2e2f47001b36539de60b09642089b6 Mon Sep 17 00:00:00 2001 From: eric Date: Wed, 8 Jul 2020 14:20:57 +0700 Subject: [PATCH 2/3] update compatible 2.3.5: fig bug validate email --- etc/adminhtml/system.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 47efd41..a0b45ad 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -35,12 +35,12 @@ - Mageplaza\Webhook\Model\Config\Backend\Email + Mageplaza\EmailAttachments\Model\Config\Backend\Email Comma-separated - Mageplaza\Webhook\Model\Config\Backend\Email + Mageplaza\EmailAttachments\Model\Config\Backend\Email Comma-separated From d203015e7d9409d5a9a5e64b4542ba1ff408070c Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 24 Jul 2020 14:00:33 +0700 Subject: [PATCH 3/3] Clean code --- composer.json | 2 +- etc/adminhtml/system.xml | 168 +++++++++++++++++++-------------------- i18n/en_US.csv | 1 + 3 files changed, 86 insertions(+), 85 deletions(-) diff --git a/composer.json b/composer.json index b968383..6c1754e 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "mageplaza/module-core": "^1.4.5" }, "type": "magento2-module", - "version": "1.0.4", + "version": "1.0.5", "license": "proprietary", "authors": [ { diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index a0b45ad..c1b9bab 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1,84 +1,84 @@ - - - - -
- - mageplaza - Mageplaza_EmailAttachments::configuration - - - - - Magento\Config\Model\Config\Source\Yesno - Yes to enable the module.]]> - - - - Mageplaza\EmailAttachments\Model\Config\Backend\Email - Comma-separated - - - - Mageplaza\EmailAttachments\Model\Config\Backend\Email - Comma-separated - - - - Magento\Config\Model\Config\Source\Yesno - - - - Mageplaza\EmailAttachments\Model\Config\Source\AttachPdf - 1 - PDF files for the above billing document(s) will be generated and attached to emails. - - 1 - - - - - Magento\Config\Model\Config\Source\Yesno - - - - Mageplaza\EmailAttachments\Model\Config\Source\AttachTaC - 1 - 'Terms and Conditions' will be attached to the above billing document(s) as a file. - - 1 - - - - - Mageplaza\EmailAttachments\Model\Config\Backend\TaCFile - Allowed upload file types: .pdf, .doc, .docx, .txt - mageplaza/email_attachments - - 1 - - - -
-
-
+ + + + +
+ + mageplaza + Mageplaza_EmailAttachments::configuration + + + + + Magento\Config\Model\Config\Source\Yesno + Yes to enable the module.]]> + + + + Mageplaza\EmailAttachments\Model\Config\Backend\Email + Comma-separated + + + + Mageplaza\EmailAttachments\Model\Config\Backend\Email + Comma-separated + + + + Magento\Config\Model\Config\Source\Yesno + + + + Mageplaza\EmailAttachments\Model\Config\Source\AttachPdf + 1 + PDF files for the above billing document(s) will be generated and attached to emails. + + 1 + + + + + Magento\Config\Model\Config\Source\Yesno + + + + Mageplaza\EmailAttachments\Model\Config\Source\AttachTaC + 1 + 'Terms and Conditions' will be attached to the above billing document(s) as a file. + + 1 + + + + + Mageplaza\EmailAttachments\Model\Config\Backend\TaCFile + Allowed upload file types: .pdf, .doc, .docx, .txt + mageplaza/email_attachments + + 1 + + + +
+
+
diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 241f783..c514295 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -1,3 +1,4 @@ +"Invalid email format.","Invalid email format." Invoice,Invoice Shipment,Shipment "Credit Memo","Credit Memo"