1313class 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