ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Hide Price (Call for Price) for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\HidePrice\Controller\Adminhtml;
|
||||
|
||||
use Magento\Backend\Model\View\Result\Page;
|
||||
use Magento\Framework\Controller\ResultFactory;
|
||||
|
||||
abstract class Request extends \Magento\Backend\App\Action
|
||||
{
|
||||
public const CURRENT_REQUEST_MODEL = 'amasty_hideprice_request_model';
|
||||
|
||||
/**
|
||||
* @var \Amasty\HidePrice\Model\RequestRepository
|
||||
*/
|
||||
protected $requestRepository;
|
||||
|
||||
/**
|
||||
* @var \Magento\Framework\Registry
|
||||
*/
|
||||
protected $coreRegistry;
|
||||
|
||||
public function __construct(
|
||||
\Magento\Backend\App\Action\Context $context,
|
||||
\Amasty\HidePrice\Model\RequestRepository $requestRepository,
|
||||
\Magento\Framework\Registry $coreRegistry
|
||||
) {
|
||||
parent::__construct($context);
|
||||
$this->requestRepository = $requestRepository;
|
||||
$this->coreRegistry = $coreRegistry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Authorization level of a basic admin session
|
||||
*
|
||||
* @see _isAllowed()
|
||||
*/
|
||||
public const ADMIN_RESOURCE = 'Amasty_HidePrice::request';
|
||||
|
||||
/**
|
||||
* Initiate action
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
protected function _initAction()
|
||||
{
|
||||
/** @var Page $resultPage */
|
||||
$resultPage = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
|
||||
$resultPage->setActiveMenu(self::ADMIN_RESOURCE);
|
||||
$resultPage->addBreadcrumb(__('Amasty Hide Price'), __('Amasty Hide Price'));
|
||||
$resultPage->getConfig()->getTitle()->prepend(__('Requests'));
|
||||
|
||||
return $resultPage;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Hide Price (Call for Price) for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\HidePrice\Controller\Adminhtml\Request;
|
||||
|
||||
|
||||
class Delete extends \Amasty\HidePrice\Controller\Adminhtml\Request
|
||||
{
|
||||
/**
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
private $logger;
|
||||
|
||||
public function __construct(
|
||||
\Magento\Backend\App\Action\Context $context,
|
||||
\Amasty\HidePrice\Model\RequestRepository $requestRepository,
|
||||
\Magento\Framework\Registry $coreRegistry,
|
||||
\Psr\Log\LoggerInterface $logger
|
||||
) {
|
||||
parent::__construct($context, $requestRepository, $coreRegistry);
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function execute()
|
||||
{
|
||||
$id = $this->getRequest()->getParam('id');
|
||||
if ($id) {
|
||||
try {
|
||||
$this->requestRepository->deleteById($id);
|
||||
$this->messageManager->addSuccessMessage(__('Request was deleted.'));
|
||||
$this->_redirect('amasty_hideprice/*/');
|
||||
|
||||
return;
|
||||
} catch (\Magento\Framework\Exception\LocalizedException $e) {
|
||||
$this->messageManager->addErrorMessage($e->getMessage());
|
||||
} catch (\Exception $e) {
|
||||
$this->messageManager->addErrorMessage(
|
||||
__('Can\'t delete item right now. Please review the log and try again.')
|
||||
);
|
||||
$this->logger->critical($e);
|
||||
$this->_redirect('amasty_hideprice/*/edit', ['id' => $id]);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
$this->messageManager->addErrorMessage(__('Can\'t find a item to delete.'));
|
||||
$this->_redirect('amasty_hideprice/*/');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Hide Price (Call for Price) for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\HidePrice\Controller\Adminhtml\Request;
|
||||
|
||||
use Amasty\HidePrice\Model\Source\Status;
|
||||
|
||||
class Edit extends \Amasty\HidePrice\Controller\Adminhtml\Request
|
||||
{
|
||||
public function execute()
|
||||
{
|
||||
$id = $this->getRequest()->getParam('id');
|
||||
if ($id) {
|
||||
try {
|
||||
$model = $this->requestRepository->get($id);
|
||||
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
|
||||
$this->messageManager->addErrorMessage(__('This request no longer exists.'));
|
||||
$this->_redirect('amasty_hideprice/*');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
$this->messageManager->addErrorMessage(__('This request no longer exists.'));
|
||||
$this->_redirect('amasty_hideprice/*');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->coreRegistry->register(\Amasty\HidePrice\Controller\Adminhtml\Request::CURRENT_REQUEST_MODEL, $model);
|
||||
|
||||
$this->_initAction();
|
||||
|
||||
$this->_view->getPage()->getConfig()->getTitle()->prepend(
|
||||
__('Get a Quote Request from ') . $model->getName()
|
||||
);
|
||||
|
||||
$this->_view->renderLayout();
|
||||
|
||||
/* change request status to viewed*/
|
||||
if ($model->getStatus() == Status::PENDING) {
|
||||
$model->setStatus(Status::VIEWED);
|
||||
$this->requestRepository->save($model);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Hide Price (Call for Price) for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\HidePrice\Controller\Adminhtml\Request;
|
||||
|
||||
class Index extends \Amasty\HidePrice\Controller\Adminhtml\Request
|
||||
{
|
||||
public function execute()
|
||||
{
|
||||
$this->_initAction();
|
||||
$this->_view->getPage()->getConfig()->getTitle()->prepend(__('Get a Quote Requests'));
|
||||
$this->_view->renderLayout();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Hide Price (Call for Price) for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\HidePrice\Controller\Adminhtml\Request;
|
||||
|
||||
class MassDelete extends \Amasty\HidePrice\Controller\Adminhtml\Request
|
||||
{
|
||||
/**
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
private $logger;
|
||||
/**
|
||||
* @var \Amasty\HidePrice\Model\ResourceModel\Request\CollectionFactory
|
||||
*/
|
||||
private $collectionFactory;
|
||||
|
||||
public function __construct(
|
||||
\Magento\Backend\App\Action\Context $context,
|
||||
\Amasty\HidePrice\Model\RequestRepository $requestRepository,
|
||||
\Magento\Framework\Registry $coreRegistry,
|
||||
\Psr\Log\LoggerInterface $logger,
|
||||
\Amasty\HidePrice\Model\ResourceModel\Request\CollectionFactory $collectionFactory
|
||||
) {
|
||||
parent::__construct($context, $requestRepository, $coreRegistry);
|
||||
$this->logger = $logger;
|
||||
$this->collectionFactory = $collectionFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$requestIds = $this->getRequest()->getParam('request_ids');
|
||||
if (!is_array($requestIds)) {
|
||||
$this->messageManager->addErrorMessage(__('Please select items.'));
|
||||
} else {
|
||||
try {
|
||||
/** @var \Amasty\HidePrice\Model\ResourceModel\Request\Collection $collection */
|
||||
$collection = $this->collectionFactory->create();
|
||||
$collection->deleteByIds($requestIds);
|
||||
|
||||
$this->messageManager->addSuccessMessage(__('Get a Quote requests are deleted.'));
|
||||
} catch (\Magento\Framework\Exception\LocalizedException $e) {
|
||||
$this->messageManager->addErrorMessage($e->getMessage());
|
||||
} catch (\Exception $e) {
|
||||
$this->messageManager->addErrorMessage(
|
||||
__('Can\'t delete items right now. Please review the log and try again.')
|
||||
);
|
||||
$this->logger->critical($e);
|
||||
}
|
||||
}
|
||||
$this->_redirect('amasty_hideprice/*/');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Hide Price (Call for Price) for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\HidePrice\Controller\Adminhtml\Request;
|
||||
|
||||
use Amasty\HidePrice\Model\Source\Status;
|
||||
use Amasty\HidePrice\Model\Validator;
|
||||
use Magento\Framework\App\ObjectManager;
|
||||
|
||||
class Send extends \Amasty\HidePrice\Controller\Adminhtml\Request
|
||||
{
|
||||
/**
|
||||
* @var \Magento\Framework\Mail\Template\TransportBuilder
|
||||
*/
|
||||
private $transportBuilder;
|
||||
|
||||
/**
|
||||
* @var \Amasty\HidePrice\Helper\Data
|
||||
*/
|
||||
private $helper;
|
||||
|
||||
/**
|
||||
* @var \Magento\Store\Model\StoreManagerInterface
|
||||
*/
|
||||
private $storeManager;
|
||||
|
||||
/**
|
||||
* @var Validator
|
||||
*/
|
||||
private $validator;
|
||||
|
||||
public function __construct(
|
||||
\Magento\Backend\App\Action\Context $context,
|
||||
\Amasty\HidePrice\Model\RequestRepository $requestRepository,
|
||||
\Magento\Framework\Registry $coreRegistry,
|
||||
\Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
|
||||
\Amasty\HidePrice\Helper\Data $helper,
|
||||
\Magento\Store\Model\StoreManagerInterface $storeManager,
|
||||
Validator $validator = null // TODO move to not optional
|
||||
) {
|
||||
parent::__construct($context, $requestRepository, $coreRegistry);
|
||||
$this->transportBuilder = $transportBuilder;
|
||||
$this->helper = $helper;
|
||||
$this->storeManager = $storeManager;
|
||||
$this->validator = $validator ?? ObjectManager::getInstance()->get(Validator::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
$id = $this->getRequest()->getParam('request_id');
|
||||
|
||||
$message = $this->getRequest()->getParam('email_text');
|
||||
if (!$this->validator->isNotEmpty(trim($message))) {
|
||||
$this->messageManager->addErrorMessage(__('Please enter a Email Text.'));
|
||||
$this->_redirect('*/*/edit', ['id' => $id]);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($id) {
|
||||
try {
|
||||
$model = $this->requestRepository->get($id);
|
||||
|
||||
$emailTo = $model->getEmail();
|
||||
$sender = $this->helper->getModuleConfig('general/sender');
|
||||
$template = $this->helper->getModuleConfig('general/template');
|
||||
if ($this->sendEmail($model, $sender, $emailTo, $template, $message)) {
|
||||
$model->setStatus(Status::ANSWERED);
|
||||
$model->setMessageText($message);
|
||||
$this->requestRepository->save($model);
|
||||
$this->messageManager->addSuccessMessage(__('Email Answer was sent.'));
|
||||
}
|
||||
} catch (\Magento\Framework\Exception\NoSuchEntityException $exception) {
|
||||
$this->messageManager->addErrorMessage(__('This request no longer exists.'));
|
||||
}
|
||||
} else {
|
||||
$this->messageManager->addErrorMessage(__('Please select request id.'));
|
||||
}
|
||||
|
||||
$this->_redirect('amasty_hideprice/*/');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Amasty\HidePrice\Model\Request $model
|
||||
* @param $sender
|
||||
* @param $emailTo
|
||||
* @param $template
|
||||
* @param $message
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function sendEmail(\Amasty\HidePrice\Model\Request $model, $sender, $emailTo, $template, $message)
|
||||
{
|
||||
try {
|
||||
$store = $this->storeManager->getStore($model->getStoreId());
|
||||
$data = [
|
||||
'website_name' => $store->getWebsite()->getName(),
|
||||
'group_name' => $store->getGroup()->getName(),
|
||||
'store_name' => $store->getName(),
|
||||
'store' => $store,
|
||||
'request' => $model,
|
||||
'message' => $message,
|
||||
'customer_name' => $model->getName()
|
||||
];
|
||||
|
||||
$transport = $this->transportBuilder->setTemplateIdentifier(
|
||||
$template
|
||||
)->setTemplateOptions(
|
||||
['area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $store->getId()]
|
||||
)->setTemplateVars(
|
||||
$data
|
||||
)->setFrom(
|
||||
$sender
|
||||
)->addTo(
|
||||
$emailTo,
|
||||
$model->getName()
|
||||
)->getTransport();
|
||||
|
||||
$transport->sendMessage();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
$this->messageManager->addErrorMessage($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
+253
@@ -0,0 +1,253 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Hide Price (Call for Price) for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\HidePrice\Controller\Request;
|
||||
|
||||
use Amasty\HidePrice\Model\Request;
|
||||
use Amasty\HidePrice\Model\Validator;
|
||||
use Magento\Framework\App\ObjectManager;
|
||||
use Magento\Framework\Exception\LocalizedException;
|
||||
|
||||
class Add extends \Magento\Framework\App\Action\Action
|
||||
{
|
||||
/**
|
||||
* @var \Magento\Framework\Data\Form\FormKey\Validator
|
||||
*/
|
||||
private $formKeyValidator;
|
||||
|
||||
/**
|
||||
* @var \Amasty\HidePrice\Model\RequestFactory
|
||||
*/
|
||||
private $requestFactory;
|
||||
|
||||
/**
|
||||
* @var \Amasty\HidePrice\Model\RequestRepository
|
||||
*/
|
||||
private $requestRepository;
|
||||
|
||||
/**
|
||||
* @var \Magento\Catalog\Model\ProductRepository
|
||||
*/
|
||||
private $productRepository;
|
||||
|
||||
/**
|
||||
* @var \Magento\Store\Model\StoreManagerInterface
|
||||
*/
|
||||
private $storeManager;
|
||||
|
||||
/**
|
||||
* @var \Magento\Framework\Json\EncoderInterface
|
||||
*/
|
||||
private $jsonEncoder;
|
||||
|
||||
/**
|
||||
* @var \Amasty\HidePrice\Helper\Data
|
||||
*/
|
||||
private $helper;
|
||||
|
||||
/**
|
||||
* @var \Magento\Framework\Mail\Template\TransportBuilder
|
||||
*/
|
||||
private $transportBuilder;
|
||||
|
||||
/**
|
||||
* @var \Psr\Log\LoggerInterface
|
||||
*/
|
||||
private $logger;
|
||||
|
||||
/**
|
||||
* @var \Magento\Framework\Data\Form\Filter\Escapehtml
|
||||
*/
|
||||
private $escapehtml;
|
||||
|
||||
/**
|
||||
* @var Validator
|
||||
*/
|
||||
private $validator;
|
||||
|
||||
public function __construct(
|
||||
\Magento\Framework\App\Action\Context $context,
|
||||
\Magento\Framework\Data\Form\FormKey\Validator $formKeyValidator,
|
||||
\Amasty\HidePrice\Model\RequestFactory $requestFactory,
|
||||
\Amasty\HidePrice\Model\RequestRepository $requestRepository,
|
||||
\Magento\Catalog\Model\ProductRepository $productRepository,
|
||||
\Magento\Store\Model\StoreManagerInterface $storeManager,
|
||||
\Magento\Framework\Json\EncoderInterface $jsonEncoder,
|
||||
\Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
|
||||
\Amasty\HidePrice\Helper\Data $helper,
|
||||
\Psr\Log\LoggerInterface $logger,
|
||||
\Magento\Framework\Data\Form\Filter\Escapehtml $escapehtml,
|
||||
Validator $validator = null // TODO move to not optional
|
||||
) {
|
||||
parent::__construct($context);
|
||||
$this->formKeyValidator = $formKeyValidator;
|
||||
$this->requestFactory = $requestFactory;
|
||||
$this->requestRepository = $requestRepository;
|
||||
$this->productRepository = $productRepository;
|
||||
$this->storeManager = $storeManager;
|
||||
$this->jsonEncoder = $jsonEncoder;
|
||||
$this->helper = $helper;
|
||||
$this->transportBuilder = $transportBuilder;
|
||||
$this->logger = $logger;
|
||||
$this->escapehtml = $escapehtml;
|
||||
$this->validator = $validator ?? ObjectManager::getInstance()->get(Validator::class);
|
||||
}
|
||||
|
||||
public function execute()
|
||||
{
|
||||
$message = [
|
||||
'error' => __(
|
||||
'Sorry. There is a problem with Your Quote Request.' .
|
||||
' Please try again or use Contact Us link in the menu.'
|
||||
)
|
||||
];
|
||||
if ($this->getRequest()->isPost()) {
|
||||
try {
|
||||
$data = $this->getValidData();
|
||||
|
||||
/** @var Request $model */
|
||||
$model = $this->requestFactory->create();
|
||||
$model->addData($data);
|
||||
$this->requestRepository->save($model);
|
||||
$message = ['success' => __('Thanks for contacting us. We\'ll respond to you as soon as possible. ')];
|
||||
|
||||
$this->sendAdminNotification($model);
|
||||
$this->sendAutoReply($model);
|
||||
|
||||
} catch (LocalizedException $e) {
|
||||
$message = ['error' => $e->getMessage()];
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
}
|
||||
}
|
||||
$this->getResponse()->representJson(
|
||||
$this->jsonEncoder->encode($message)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates all data
|
||||
*
|
||||
* @throws LocalizedException
|
||||
* @return array
|
||||
*/
|
||||
private function getValidData()
|
||||
{
|
||||
$data = $this->getRequest()->getPostValue();
|
||||
|
||||
if (!$this->formKeyValidator->validate($this->getRequest())) {
|
||||
throw new LocalizedException(
|
||||
__('Form key is not valid. Please try to reload the page.')
|
||||
);
|
||||
}
|
||||
|
||||
if (!$this->validator->isValidEmail($data['email'])) {
|
||||
throw new LocalizedException(__('Please enter a valid email address.'));
|
||||
}
|
||||
|
||||
$data['name'] = $this->escapehtml->outputFilter(trim($data['name']));
|
||||
if (!$this->validator->isNotEmpty($data['name'])) {
|
||||
throw new LocalizedException(__('Please enter a name.'));
|
||||
}
|
||||
|
||||
$data['phone'] = $this->escapehtml->outputFilter(trim($data['phone']));
|
||||
if (!$this->validator->isNotEmpty($data['phone'])) {
|
||||
throw new LocalizedException(__('Please enter a phone.'));
|
||||
}
|
||||
|
||||
$data['product_id'] = (int)$data['product_id'];
|
||||
if (!$this->validator->isNotEmpty($data['product_id'])
|
||||
|| !($product = $this->productRepository->getById($data['product_id']))
|
||||
) {
|
||||
throw new LocalizedException(__('There are no product for your request.'));
|
||||
} else {
|
||||
$data['product_name'] = $product->getName();
|
||||
}
|
||||
|
||||
if (array_key_exists('comment', $data)) {
|
||||
$data['comment'] = $this->escapehtml->outputFilter(trim($data['comment']));
|
||||
}
|
||||
|
||||
if ($this->helper->isGDPREnabled() && (!isset($data['gdpr']) || !$data['gdpr'])) {
|
||||
throw new LocalizedException(__('Please agree to the Privacy Policy'));
|
||||
}
|
||||
|
||||
$data['store_id'] = $this->storeManager->getStore()->getId();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $model
|
||||
*/
|
||||
private function sendAdminNotification(Request $model)
|
||||
{
|
||||
$emailTo = trim($this->helper->getModuleConfig('admin_email/to'));
|
||||
if ($emailTo) {
|
||||
$emailTo = explode(',', $emailTo);
|
||||
$sender = $this->helper->getModuleConfig('admin_email/sender');
|
||||
$template = $this->helper->getModuleConfig('admin_email/template');
|
||||
$this->sendEmail($model, $sender, $emailTo, $template);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $model
|
||||
*/
|
||||
private function sendAutoReply(Request $model)
|
||||
{
|
||||
$enabled = $this->helper->getModuleConfig('reply_email/enabled');
|
||||
if ($enabled) {
|
||||
$emailTo = [$model->getEmail()];
|
||||
$sender = $this->helper->getModuleConfig('reply_email/sender');
|
||||
$template = $this->helper->getModuleConfig('reply_email/template');
|
||||
$this->sendEmail($model, $sender, $emailTo, $template);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $model
|
||||
* @param $sender
|
||||
* @param array $emailTo
|
||||
* @param $template
|
||||
*/
|
||||
private function sendEmail(Request $model, $sender, $emailTo, $template)
|
||||
{
|
||||
try {
|
||||
$store = $this->storeManager->getStore();
|
||||
$first = array_shift($emailTo);
|
||||
$data = [
|
||||
'website_name' => $store->getWebsite()->getName(),
|
||||
'group_name' => $store->getGroup()->getName(),
|
||||
'store_name' => $store->getName(),
|
||||
'store' => $store,
|
||||
'request' => $model,
|
||||
'customer_name' => $model->getName()
|
||||
];
|
||||
|
||||
$transport = $this->transportBuilder->setTemplateIdentifier(
|
||||
$template
|
||||
)->setTemplateOptions(
|
||||
['area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $store->getId()]
|
||||
)->setTemplateVars(
|
||||
$data
|
||||
)->setFrom(
|
||||
$sender
|
||||
)->addTo(
|
||||
$first,
|
||||
$model->getName()
|
||||
)->addTo(
|
||||
$emailTo,
|
||||
$model->getName()
|
||||
)->getTransport();
|
||||
|
||||
$transport->sendMessage();
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->critical($e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user