From cdb032d5b98d0ea24eec1d18d15f8930469b159a Mon Sep 17 00:00:00 2001 From: Renon Stewart Date: Thu, 16 Mar 2023 14:31:06 -0400 Subject: [PATCH] Add Support for Magento 2.4.6 and PHP 8.2 --- Mail/Smtp.php | 1 - Model/Transport.php | 62 ------------------------ Plugin/Mail/TransportPlugin.php | 5 ++ composer.json | 8 +-- etc/adminhtml/system.xml | 4 +- etc/di.xml | 7 --- view/adminhtml/web/js/validate-config.js | 6 +-- 7 files changed, 14 insertions(+), 79 deletions(-) delete mode 100755 Model/Transport.php diff --git a/Mail/Smtp.php b/Mail/Smtp.php index b54cbe0..481554f 100644 --- a/Mail/Smtp.php +++ b/Mail/Smtp.php @@ -23,7 +23,6 @@ /** * Class Smtp - * For Magento <= 2.2.7 */ class Smtp { diff --git a/Model/Transport.php b/Model/Transport.php deleted file mode 100755 index 9bb003b..0000000 --- a/Model/Transport.php +++ /dev/null @@ -1,62 +0,0 @@ -_message = $message; - } - - /** - * Send a mail using this transport - * - * @return void - * @throws MailException - */ - public function sendMessage() - { - try { - parent::send($this->_message); - } catch (Exception $e) { - throw new MailException(new Phrase($e->getMessage()), $e); - } - } - - /** - * @return MessageInterface|Zend_Mail - */ - public function getMessage() - { - return $this->_message; - } -} diff --git a/Plugin/Mail/TransportPlugin.php b/Plugin/Mail/TransportPlugin.php index 6f4e83a..a50c2da 100644 --- a/Plugin/Mail/TransportPlugin.php +++ b/Plugin/Mail/TransportPlugin.php @@ -13,6 +13,7 @@ use Magento\Framework\Mail\Message; use Magento\Framework\Mail\TransportInterface; use MagePal\CustomSmtp\Helper\Data; +use MagePal\CustomSmtp\Mail\SmtpFactory; use MagePal\CustomSmtp\Mail\Smtp; use MagePal\CustomSmtp\Model\Store; @@ -27,6 +28,9 @@ class TransportPlugin * @var Store */ protected $storeModel; + /** + * @var Smtp + */ private SmtpFactory $smtpFactory; /** @@ -60,6 +64,7 @@ public function aroundSendMessage( $message = $subject->getMessage(); if ($message instanceof Message || $message instanceof EmailMessageInterface) { + /** @var Smtp $smtp */ $smtp = $this->smtpFactory->create( ['dataHelper' => $this->dataHelper, 'storeModel' => $this->storeModel] ); diff --git a/composer.json b/composer.json index f6f6b91..f3192b8 100644 --- a/composer.json +++ b/composer.json @@ -18,10 +18,10 @@ "how to setup email magento2" ], "require": { - "php": "~5.6.0|7.0.2|7.0.4|~7.0.6|~7.1.0|~7.1.3|~7.2.0|~7.3.0|~7.4.0|~8.1.0", - "magento/module-backend": "100.0.*|100.1.*|100.2.*|101.0.*|102.0.*", - "magento/framework": "100.0.*|100.1.*|101.0.*|102.0.*|103.0.*", - "magepal/magento2-core": ">=1.1.11" + "php": "~7.4.0||~8.1.0||~8.2.0", + "magento/module-backend": "102.0.*", + "magento/framework": "103.0.*", + "magepal/magento2-core":">=1.1.11" }, "license": [ "proprietary" diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index f8569ee..453abf4 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -21,7 +21,7 @@ - Copyright © 2022 MagePal, LLC + Copyright © 2023 MagePal, LLC Documentation Support Latest Version @@ -30,7 +30,7 @@
Get more from your order confirmation emails by promoting other complementary products! - Learn more about our new Enhanced Transactional Email extension. + Learn more about our new Email Promotional Products extension.

]]> diff --git a/etc/di.xml b/etc/di.xml index 9f58a34..a6f219d 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -7,13 +7,6 @@ */ --> - - - - - - - diff --git a/view/adminhtml/web/js/validate-config.js b/view/adminhtml/web/js/validate-config.js index 2d1771c..8d574fd 100755 --- a/view/adminhtml/web/js/validate-config.js +++ b/view/adminhtml/web/js/validate-config.js @@ -16,11 +16,11 @@ define([ /** global var configForm **/ configForm.find('[id^=magepal_custom_smtp]').find(':input').serializeArray().map(function (field) { - var name = field.name.match(/groups\[custom_smtp\]?(\[groups\]\[debug\])?\[fields\]\[(.*)\]\[value]/); + var name = field.name.match(/groups\[general\]?(\[groups\]\[debug\])?\[fields\]\[(.*)\]\[value]/); /** - * groups[custom_smtp][groups][debug][fields][email][value] - * groups[custom_smtp][fields][password][value] + * groups[general][groups][debug][fields][email][value] + * groups[general][fields][password][value] */ if (name && name.length === 3) {