Skip to content

Commit a7922e9

Browse files
Task Plugin 86 87 89 97 also done
1 parent 0da6683 commit a7922e9

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

Controller/Adminhtml/index/Ajax.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,9 @@ public function loadContact()
460460
} else {
461461
$imgSendinBlue = '<img src="'.$blockObj->getViewFileUrl('Sendinblue_Sendinblue::images/disabled.gif').'" id="ajax_contact_status_'.$i.'" title="'.$title2.'" >';
462462
}
463-
463+
$imgMagento = str_replace('_view','Magento/backend', $imgMagento);
464+
$imgSendinBlue = str_replace('_view','Magento/backend', $imgSendinBlue);
465+
$imgSms = str_replace('_view','Magento/backend', $imgSms);
464466
$message .= '<tr class="even pointer"><td class="a-left">'.$email.'</td><td class="a-left">'.$client.'</td><td class="a-left">'.$phone.'</td><td class="a-left">'.$imgMagento.'</td>
465467
<td class="a-left"><a status="'.$showStatus.'" email="'.$email.'" class="ajax_contacts_href" href="javascript:void(0)">
466468
'.$imgSendinBlue.'</a></td><td class="a-left last">

Model/SendinblueSib.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,7 @@ public function smtpSendMail($userEmail, $title, $tempName, $paramVal)
12271227
$lang = $this->getDbData('sendin_config_lang');
12281228

12291229
$path = $this->_blocktemp->getViewFileUrl('Sendinblue_Sendinblue::email_temp/'.strtolower($lang).'/'.$tempName.'.html');
1230+
$path = str_replace('_view','Magento/backend', $path);
12301231
$bodyContent = file_get_contents($path);
12311232
if (!empty($paramVal)) {
12321233
foreach($paramVal as $key=>$replaceVal) {

Model/Transport.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
class Transport
1414
{
1515
/** @var MessageInterface */
16-
protected $_message;
16+
protected $_message;
17+
18+
protected $_scopeConfig;
19+
1720

1821
/** @var Smtp|\Zend_Mail_Transport_Smtp **/
1922
protected $transport;
@@ -25,8 +28,9 @@ class Transport
2528
* @throws \InvalidArgumentException
2629
*/
2730
public function __construct(MessageInterface $message, ScopeConfigInterface $scopeConfig ){
28-
$this->_message = $message;
29-
31+
$this->_message = $message;
32+
$this->_scopeConfig = $scopeConfig;
33+
3034
$relaySib = $scopeConfig->getValue('sendinblue/relay_data_status', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
3135
if ($relaySib == 'enabled') {
3236
$smtpHost = "smtp-relay.sendinblue.com";
@@ -56,8 +60,8 @@ public function __construct(MessageInterface $message, ScopeConfigInterface $sco
5660
],
5761
]));
5862
}
59-
}
60-
}
63+
}
64+
}
6165

6266
/**
6367
* Send a mail using this transport
@@ -66,17 +70,23 @@ public function __construct(MessageInterface $message, ScopeConfigInterface $sco
6670
*/
6771
public function sendMessage()
6872
{
69-
if(null !== $this->transport){
73+
if ($this->_scopeConfig->isSetFlag('system/smtp/disable',\Magento\Store\Model\ScopeInterface::SCOPE_STORE)) {
74+
return false;
75+
}
76+
if(null !== $this->transport) {
7077
try {
7178
if ($this->_message instanceof \Zend_mail) {
7279
$this->transport->send($this->_message);
7380
} elseif ($this->_message instanceof MessageInterface) {
74-
$this->transport->send(Message::fromString($this->_message->getRawMessage()));
81+
$zend_mail = Message::fromString($this->_message->getRawMessage());
82+
$subject = $zend_mail->getSubject();
83+
$zend_mail->setSubject(htmlspecialchars_decode((string)$subject, ENT_QUOTES));
84+
$this->transport->send($zend_mail);
7585
}
7686
} catch (\Exception $e) {
7787
throw new \Magento\Framework\Exception\MailException(new \Magento\Framework\Phrase($e->getMessage()), $e);
7888
}
79-
}
89+
}
8090
}
8191

8292
/**

0 commit comments

Comments
 (0)