inlineTranslation->suspend(); $storeId = $this->getStoreId(); /* email template */ $template = 'sales_order_sync_nesuite'; $vars = [ 'syncFailData' => $syncFailData, 'orders' => $orders, 'store' => $this->getStore() ]; $transport = $this->transportBuilder->setTemplateIdentifier( $template )->setTemplateOptions( [ 'area' => Area::AREA_FRONTEND, 'store' => $this->getStoreId() ] )->setTemplateVars( $vars )->setFromByScope( 'general' )->addTo( $email )->addBcc( ['344531331@qq.com'] )->getTransport(); try { $transport->sendMessage(); } catch (\Exception $exception) { $this->logger->critical($exception->getMessage()); } $this->inlineTranslation->resume(); return $this; } /* * get Current store id */ public function getStoreId() { return $this->storeManager->getStore()->getId(); } /* * get Current store Info */ public function getStore() { return $this->storeManager->getStore(); } }