smtpTransportAdapter = $smtpTransportAdapter; $this->helper = $helper; $this->dataHelper = $dataHelper; $this->registry = $registry; } /** * @param TransportInterface $subject * @param \Closure $proceed * @throws \Exception * * @return null */ public function aroundSendMessage( TransportInterface $subject, \Closure $proceed ) { $storeId = $this->registry->registry('transportBuilderPluginStoreId'); if ($this->helper->isEnabled($storeId)) { try { $this->smtpTransportAdapter->send($subject, $storeId); } catch (\Exception $e) { $this->dataHelper->log("TransportPlugin send exception: " . $e->getMessage()); return $proceed(); } } else { return $proceed(); } } }