b374k
m1n1 1.01
Apache/2.4.41 (Ubuntu)
Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64
uid=33(www-data) gid=33(www-data) groups=33(www-data)
server ip : 62.171.164.128 | your ip : 127.0.0.1
safemode OFF
 >  / home / dev2.destoffenstraat.com / app / code / Bss / AdminEmailNotification / Plugin / Model /
Filename/home/dev2.destoffenstraat.com/app/code/Bss/AdminEmailNotification/Plugin/Model/Subscriber.php
Size2.49 kb
Permissionrw-rw-r--
Ownerroot : root
Create time17-Aug-2025 10:26
Last modified15-May-2023 05:10
Last accessed22-Aug-2025 11:58
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?php
/**
* BSS Commerce Co.
*
* NOTICE OF LICENSE
*
* This source file is subject to the EULA
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://bsscommerce.com/Bss-Commerce-License.txt
*
* @category BSS
* @package Bss_AdminEmailNotification
* @author Extension Team
* @copyright Copyright (c) 2017-2023 BSS Commerce Co. ( http://bsscommerce.com )
* @license http://bsscommerce.com/Bss-Commerce-License.txt
*/

namespace Bss\AdminEmailNotification\Plugin\Model;

use Bss\AdminEmailNotification\Helper\Data;
use Bss\AdminEmailNotification\Helper\Email;

class Subscriber
{
/**
* @var Data
*/
protected $helperData;

/**
* @var Email
*/
protected $helperEmail;

/**
* @var \Magento\Framework\App\Request\Http
*/
protected $request;

/**
* Subscriber constructor.
*
* @param Data $helperData
* @param Email $helperEmail
* @param \Magento\Framework\App\Request\Http $request
*/
public function __construct(
Data $helperData,
Email $helperEmail,
\Magento\Framework\App\Request\Http $request
) {
$this->helperData = $helperData;
$this->helperEmail = $helperEmail;
$this->request = $request;
}

/**
* @param $subject
* @param $result
* @return mixed
*/
public function afterGetStatus($subject, $result)
{
$fullAction = $this->request->getFullActionName();
$email = (string)$this->request->getPost('email');

if ($email && $result != \Magento\Newsletter\Model\Subscriber::STATUS_NOT_ACTIVE && $fullAction == 'newsletter_subscriber_new') {

$email = (string)$this->request->getPost('email');
$enable = $this->helperData->isEnableSubcribeEmail();
if ($enable && $this->helperData->getSubcribeEmailReceiver()) {
$receivers = $this->helperData->getSubcribeEmailReceiver();
$receivers = str_replace(' ', '', $receivers);
$receivers = (explode(',', $receivers));
$emailTemplate = $this->helperData->getSubcribeEmailTemplate();
$templateVar = [
'varEmail' => __('Guest Email: ' . $email),
];
$this->helperEmail->sendEmail($receivers, $emailTemplate, $templateVar);
}
}
return $result;
}
}