Skip to content

Commit

Permalink
Merge pull request #419 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
2.4 develop
  • Loading branch information
chuccv authored Dec 3, 2024
2 parents 3278b49 + 5ef0cd2 commit 68ad9f5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 46 deletions.
20 changes: 10 additions & 10 deletions Block/Adminhtml/AbandonedCart/Edit/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ public function __construct(
GroupRepositoryInterface $groupRepository,
array $data = []
) {
$this->addressConfig = $addressConfig;
$this->priceCurrency = $priceCurrency;
$this->emailIdentity = $emailIdentity;
$this->emailTemplate = $emailTemplate;
$this->taxConfig = $taxConfig;
$this->addressConfig = $addressConfig;
$this->priceCurrency = $priceCurrency;
$this->emailIdentity = $emailIdentity;
$this->emailTemplate = $emailTemplate;
$this->taxConfig = $taxConfig;
$this->logCollectionFactory = $logCollectionFactory;
$this->helperEmailMarketing = $helperEmailMarketing;
$this->groupRepository = $groupRepository;
$this->groupRepository = $groupRepository;

parent::__construct($context, $registry, $formFactory, $data);
}
Expand Down Expand Up @@ -189,10 +189,10 @@ public function getHelperEmailMarketing()
*/
public function getSubtotal(Quote $quote, $inclTax = false)
{
$address = $quote->isVirtual() ? $quote->getBillingAddress() : $quote->getShippingAddress();
$address = $quote->isVirtual() ? $quote->getBillingAddress() : $quote->getShippingAddress();
$subtotal = $inclTax ? $address->getSubtotalInclTax() : $address->getSubtotal();

return $this->formatPrice($subtotal, $quote->getId());
return $this->formatPrice($subtotal, $quote->getStoreId());
}

/**
Expand Down Expand Up @@ -362,8 +362,8 @@ public function isSingleStoreMode()
public function getStoreName(Quote $quote)
{
$storeId = $quote->getStoreId();
$store = $this->_storeManager->getStore($storeId);
$name = [$store->getWebsite()->getName(), $store->getGroup()->getName(), $store->getName()];
$store = $this->_storeManager->getStore($storeId);
$name = [$store->getWebsite()->getName(), $store->getGroup()->getName(), $store->getName()];

return implode('<br/>', $name);
}
Expand Down
68 changes: 34 additions & 34 deletions Mail/Transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,58 +97,58 @@ public function __construct(
}

/**
* Around send message
*
* @param TransportInterface $subject
* @param Closure $proceed
*
* @throws MailException
* @throws Zend_Exception
*/
public function aroundSendMessage(
TransportInterface $subject,
Closure $proceed
) {
public function aroundSendMessage(TransportInterface $subject, Closure $proceed)
{
$this->_storeId = $this->registry->registry('mp_smtp_store_id');
$message = $this->getMessage($subject);

if ($this->resourceMail->isModuleEnable($this->_storeId) && $message) {
if ($this->helper->versionCompare('2.2.8')) {
$message = Message::fromString($message->getRawMessage())->setEncoding('utf-8');
}
if (!$this->resourceMail->isModuleEnable($this->_storeId)) {
$proceed();

if (!$this->validateBlacklist($message)) {
$message = $this->resourceMail->processMessage($message, $this->_storeId);
$transport = $this->resourceMail->getTransport($this->_storeId);
try {
if (!$this->resourceMail->isDeveloperMode($this->_storeId)) {
if ($this->helper->versionCompare('2.3.3')) {
$message->getHeaders()->removeHeader("Content-Disposition");
}
$transport->send($message);
return;
}
$message = $this->getMessage($subject);
if ($this->helper->versionCompare('2.2.8')) {
$message = Message::fromString($message->getRawMessage())->setEncoding('utf-8');
}
if (!$this->validateBlacklist($message)) {
$message = $this->resourceMail->processMessage($message, $this->_storeId);
try {
if (!$this->resourceMail->isDeveloperMode($this->_storeId)) {
if ($this->helper->versionCompare('2.3.3')) {
$message->getHeaders()->removeHeader("Content-Disposition");
}
$transport = $this->resourceMail->getTransport($this->_storeId);
$transport->send($message);

if ($this->helper->versionCompare('2.2.8')) {
$messageTmp = $this->getMessage($subject);
if ($messageTmp && is_object($messageTmp)) {
$body = $messageTmp->getBody();
if (is_object($body) && $body->isMultiPart()) {
$message->setBody($body->getPartContent("0"));
}
if ($this->helper->versionCompare('2.2.8')) {
$messageTmp = $this->getMessage($subject);
if ($messageTmp && is_object($messageTmp)) {
$body = $messageTmp->getBody();
if (is_object($body) && $body->isMultiPart()) {
$message->setBody($body->getPartContent("0"));
}
}

$this->emailLog($message);
}
} catch (Exception $e) {
$this->emailLog($message, false);
throw new MailException(new Phrase($e->getMessage()), $e);
}
$this->emailLog($message);
} catch (Exception $e) {
$this->emailLog($message, false);
throw new MailException(new Phrase($e->getMessage()), $e);
}
} else {
$proceed();
}
}

/**
* @param $transport
* Get message
*
* @param TransportInterface $transport
*
* @return mixed|null
*/
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "mageplaza/module-smtp",
"description": "SMTP Extension for Magento 2 helps the owner of store simply install SMTP (Simple Mail Transfer Protocol) server which transmits the messages into codes or numbers",
"require": {
"mageplaza/module-core": "^1.5.7"
"mageplaza/module-core": "^1.5.9"
},
"type": "magento2-module",
"version": "4.7.13",
"version": "4.7.14",
"license": "proprietary",
"authors": [
{
Expand Down

0 comments on commit 68ad9f5

Please sign in to comment.