-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #342 from mageplaza/2.4-develop
2.4 develop
- Loading branch information
Showing
12 changed files
with
354 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?php | ||
/** | ||
* 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 | ||
*/ | ||
|
||
namespace Mageplaza\Smtp\Observer\Customer; | ||
|
||
use Exception; | ||
use Magento\Framework\Event\Observer; | ||
use Magento\Framework\Event\ObserverInterface; | ||
use Magento\PageCache\Model\Cache\Type; | ||
use Mageplaza\Smtp\Helper\Data; | ||
use Mageplaza\Smtp\Helper\EmailMarketing; | ||
use Zend_Cache; | ||
|
||
/** | ||
* Class LoginSuccess | ||
* @package Mageplaza\Smtp\Observer\Customer | ||
*/ | ||
class LoginSuccess implements ObserverInterface | ||
{ | ||
/** | ||
* @var Type | ||
*/ | ||
protected $fullPageCache; | ||
|
||
/** | ||
* @var EmailMarketing | ||
*/ | ||
protected $helperEmailMarketing; | ||
|
||
/** | ||
* @var Data | ||
*/ | ||
protected $helperData; | ||
|
||
/** | ||
* LoginSuccess constructor. | ||
* | ||
* @param Type $fullPageCache | ||
* @param Data $helperData | ||
* @param EmailMarketing $helperEmailMarketing | ||
*/ | ||
public function __construct( | ||
Type $fullPageCache, | ||
Data $helperData, | ||
EmailMarketing $helperEmailMarketing | ||
) { | ||
$this->fullPageCache = $fullPageCache; | ||
$this->helperData = $helperData; | ||
$this->helperEmailMarketing = $helperEmailMarketing; | ||
} | ||
|
||
/** | ||
* @param Observer $observer | ||
*/ | ||
public function execute(Observer $observer) | ||
{ | ||
try { | ||
$scopeId = $this->helperData->getScopeId(); | ||
} catch (Exception $e) { | ||
$scopeId = null; | ||
} | ||
|
||
if ($this->helperEmailMarketing->isEnableEmailMarketing($scopeId)) { | ||
$this->fullPageCache->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, [EmailMarketing::CACHE_TAG]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* 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 | ||
*/ | ||
|
||
namespace Mageplaza\Smtp\Plugin\Model\Template; | ||
|
||
use Magento\Email\Model\Template\Config as EmailConfig; | ||
|
||
/** | ||
* Class Config | ||
* @package Mageplaza\Smtp\Plugin\Model\Template | ||
*/ | ||
class Config | ||
{ | ||
/** | ||
* @param EmailConfig $subject | ||
* @param array $templates | ||
* | ||
* @return array | ||
*/ | ||
public function afterGetAvailableTemplates(EmailConfig $subject, $templates) | ||
{ | ||
$key = array_search('mpsmtp_abandoned_cart_email_template', array_column($templates, 'value')); | ||
unset($templates[$key]); | ||
|
||
return $templates; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?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:framework:ObjectManager/etc/config.xsd"> | ||
<type name="Magento\Email\Model\Template\Config"> | ||
<plugin name="mageplaza_smtp_template_abandoned_cart" type="Mageplaza\Smtp\Plugin\Model\Template\Config" /> | ||
</type> | ||
</config> |
Oops, something went wrong.